Hi.
Can someone help me with this problem:
with preg_replace() i want to match and replace:
ALL & AND SUBSTITUTE WITH & if it's in a hyperlink title (ie. between > and </a>
-larsw-
This is a very easy regex.
With PCRE you would use:
<code> $result = preg_replace("/&/i","&",$orig); </code>
With EREG you would use:
<code> $result = ereg_replace("&","&",$orig); </Code>
Good luck. Rob
can you clarify what you are asking? I read it as "replace '&' with '&' inside hyperlink titles".
yea... HTML is messing this up.
try this:
$str = preg_replace("/&/i","&amp;",$orig);
or
$str = ereg_replace("&","&amp;",$orig);