note 19728 added to function.str-replace
| From: | bmpc at megamail dot pt | Date: | Fri, 08 Mar 2002 21:19:33 +0000 |
| Subject: | note 19728 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27529@lists.php.net to get a copy of this message | ||
Some people seam to be having trouble understanding this function so I'll try to put in a bit
simpler.
str_replace ( what, with, from )
What is the string you want to replace.
With is what you want to put in those places.
From is the string of origin, where the search will happen.
So, if you want to replace the spaces in
$string = "my string 111111";
with the word SPACE, you can do:
str_replace ( " ", "SPACE", $string );
--
http://www.php.net/manual/en/function.str-replace.php
http://master.php.net/manage/user-notes.php?action=edit+19728
http://master.php.net/manage/user-notes.php?action=delete+19728
http://master.php.net/manage/user-notes.php?action=reject+19728