str_replace parameter count
Posted: Mon Apr 19, 2004 8:25 pm
Ok, I'm running PHP 4.3.4. I'm trying to get str_replace working with 4 parameters, but it keeps complaining. This is from the manual:
However, I always get the following error:
What I'm trying to do ultimately is eliminate a few chars (like ', ", and *) from a string and be able to tell if it found and replaced any of those chars. Is there a better way to do this?
Here's the code I'm trying to use (from the manual, also):mixed str_replace ( mixed search, mixed replace, mixed subject [, int &count])
Code: Select all
<?php
$str = str_replace("ll", "", "good golly miss molly!", $count);
?>Any ideas why? Am I just being stupid?Warning: Wrong parameter count for str_replace()
What I'm trying to do ultimately is eliminate a few chars (like ', ", and *) from a string and be able to tell if it found and replaced any of those chars. Is there a better way to do this?