the problem with str_replace


Posted on 16th Feb 2014 07:03 pm 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?

No comments posted yet

Your Answer:

Login to answer
206 Like 45 Dislike
Previous forums Next forums
Other forums

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

PHP & Java
Hello,

can PHP code be used inside java code?

Code: [Select]<SCRIPT LANGUAGE=&q

Adding to an Int row in db
Hi, i have a database which houses all of the users of my site. One of the columns is for points whi

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in t

What exactly is net neatrality?
What exactly is it? I think it's anti-censorship and... stuff... but I don't really understand it

how to remove in php string display
My code is

$message="We're looking at developing our website.";

$body= "

how to timeout $doc = new DOMDocument()->load($url)
I am currently using this $doc->load($url) to fetch an rss feed.
If a feed takes long than

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash