Question about str_replace()
| From: | Al | Date: | Sat, 22 Feb 2003 20:31:18 +0000 |
| Subject: | Question about str_replace() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136664@lists.php.net to get a copy of this message | ||
I have a simple str_replace function that obviously has a syntax problem. The [p] in the $find array ignores the brackets. Every "p" in my text is replaced by a <br>. Just for the heck of it, I've tried " instead of ', and preg_replace(), etc.
$find= array('& ','W&OD', '"&"', chr(146), '[p]');
$replace= array("& ","W&OD", '"&"', "'", '<br>');
$words= str_replace ($find, $replace, $text);
Thanks.....