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);

Did you know?Explore Trending and Topic pages for more stories like this.

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

adding 0 to numbers
Hey guys i need to create a 00001 number in a loop. Is there a better way of forcing a 5 digit numbe

with clause
hi all, i have a big query that usually access the same table more than once. for example, i have s

insert PHP code into function
Hi,
I'm having problems when trying following:

I have:
Code: [Select]createBar("Do

Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pri

Typing math
I've added support for typesetting math using LaTeX on the forums.

Example:
Code: [Select]

Join Query Help
Hi all,

I am having problems with the below code, which we shall call 'my first join query'!

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Transport data between itab and textfield on ALV event
Hallo,

I have a ALV Grid ( cl_gui_alv_grid ) and I also have hotspot click event with a h

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

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