The php str_replace function works if I don't include the "count" option, but I actually want to use the count option. I even copied and pasted the code from w3schools and php.net directly into my source and it's not working. Here are examples that are not working: $str = str_replace("ll", "", "good golly miss molly!", $count); echo $count; //Should echo "2" // // $arr = array("blue","red","green","yellow"); print_r(str_replace("red","pink",$arr,$i)); echo "Replacements: $i"; //Should echo "Replacements: 1" PHP:
I am not home to check but my host is 1and1. I do know that the function str_ireplace brings up an error message if that is a clue.
Well, 1and1 is one of the worst hosts out there (no offense) and chances are that you have PHP4 by default. Maybe you need to enable PHP5 as it suggested by them here: http://faq.1and1.com/scripting_languages_supported/htaccess/7.html I hope it helps.
Yes looking on php.net, the $count param was added in 5.0.0: http://uk.php.net/str_replace Looks like your on PHP4. Try adding phpinfo(); to a php file and loading it in the browser to see the current php config.