Basic RegEx question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
If I have this:

$xmlstr = str_replace("&", "%amp;%", $xmlstr);

How can I use use a regex expression (if it is needed) to do the replace
UNLESS the string contains A&E (you know, the TV channel).

Re: Basic RegEx question

m|sf|t wrote:
Quoted text here. Click to load it

$xmlstr =
   stristr($xmlstr, 'A&E')
     ? 'A&E'
     : str_replace("&", "%amp;%", $xmlstr);

Site Timeline