the problem with str_replace

Posted on 16th Feb 2014 by admin

$str="hahahahahahahahahahahahahaha";
$nn=1;
$str=str_replace('ha','MyGod',$str,$nn);


echo $str;

the result is MyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGodMyGod

Why $nn has no effect?the version of my php?

Other forums