Re: note 11517 added to str_replace

From: Date: Fri, 23 Feb 2001 09:45:32 +0000
Subject: Re: note 11517 added to str_replace
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-11461@lists.php.net to get a copy of this message
Perhaps the wording of the description needs to be even more clear than it is, but the prototype clearly states: mixed str_replace (mixed search, mixed replace, mixed subject) It does not indicate that the function returns (void) or (boolean) as functions that change directly their arguments usually do. And the example should also be a hint on this behaviour, which should make things clear if the description of the process and the prototype did not. I will include the info above in your note, or remove the note altogether if you want that. Let me know soon. --- tjchamberlain@hotmail.com wrote: > This function does _NOT_ (as the introduction says) > "Replace all occurrences of the search string in > subject with the replacement string" > > ... instead it _returns_ a copy of subject with all > occurrences of the search string replaced with the > replacement string. > > str_replace("x", "y", $str) does nothing.... > > $str = str_replace("x", "y", $str) does what the > introduction says. > > > http://www.php.net/manual/en/function.str-replace.php > > > > -- > PHP Notes Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-notes-unsubscribe@lists.php.net > For additional commands, e-mail: > php-notes-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > ===== --- Jesus M. Castagnetto <jmcastagnetto@php.net> __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

« previous php.notes (#11461) next »