August 10th, 2009, 04:22 PM
Join Date: Aug 2009
Time spent in forums: 18 m 41 sec
Reputation Power: 0
Simple regex question
Please look @ the following
$value = array("/-/","/between/","/and/");
$wc = trim(preg_replace($value, substr($value,1,-1), $wc));
lets say $wc is initialized with
computers between 1000 and 2000
it gets changed to
computer - 1000 - 2000
that is perfect.
now lets say wc is
how can i get preg_replace to not replace 'and' in the
second phrase yet keep the functionality of replacing 'and' in the first phrase?