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

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <

import table with dependency
Hi

What is the best way to import table back which has dependency?

SQL> cre

Query issues
I probably have this setup wrong well I know I do because nothing is showing up now. What I want is

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

php web service error
hey guys,
I'm working on a project requires the use of web services. I've been trying a few tutor

help need on ob_start()
Hi

I am a newbie in php, I have a code
Line number On/Off | Expand/Contract <?phpo

Warning: mysql_num_rows() expects parameter 1
When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3

calculator
I can't figure out why this code doesn't work. No error messages. Page loads.

Code: <

limit string by words??
hello all,

I was wonder if there is a function to limit a string by the number of words inste

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