Forum Moderators: coopster
I tried to do a string replace in my document but it failed. I tried to replace 2 animals monkey and cow.
It works when I remove 'return (str_replace("cow", "bull", $buffer));' which means I only can replace 'monkey'
How do we replace as many animals as we want?
<?php
function callback($buffer)
{
return (str_replace("monkey", "apes", $buffer));
return (str_replace("cow", "bull", $buffer));
}
ob_start("callback");
?>
monkey kills cow
<?php
ob_end_flush();
?>