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

Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related codi

RadioButtonList data selection
view plaincopy to clipboardprint?

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

help with calculations on a flat text file
hello,
I have this code below that is attached to a flat file like this:
Email:LastName:FirstN

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove

How can I Compare two xml documents?
Hi all,

I am doing a POC for my project and I am using XE database 10g version.

Concatenate two strings ???
I have string one $string1 and another $string2.

How to concatenate (add) both of them $str

Got A Free Server :(
So I was given a free server

http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1

Motivational Posters
Hello,

I wonder how can i do them in php. Are there any sample codes that you can show me?

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