Hi,
I'm trying to replace strings in a body of html. These strings may
contain spaces. str_replace works perfectly, except that it is
case-sensitive. I've tried using eregi_replace, but I think there is
something wrong with my regex's. Here is my current code:
$bword may contain something like: "testing testing 123"
$bword = trim ($bword); //Remove trailing newlines
str_replace (' ', '[\s]', $bword); //Change spaces to [\s]
$urlhtml = eregi_replace ("[\s]($bword)[\s]", $replacecode, $urlhtml);
It seems to pick up some words, but not all......
I'm trying to replace strings in a body of html. These strings may
contain spaces. str_replace works perfectly, except that it is
case-sensitive. I've tried using eregi_replace, but I think there is
something wrong with my regex's. Here is my current code:
$bword may contain something like: "testing testing 123"
$bword = trim ($bword); //Remove trailing newlines
str_replace (' ', '[\s]', $bword); //Change spaces to [\s]
$urlhtml = eregi_replace ("[\s]($bword)[\s]", $replacecode, $urlhtml);
It seems to pick up some words, but not all......
Comment