note 40948 added to function.str-replace
| From: | php at hsmx dot com | Date: | Wed, 24 Mar 2004 11:41:43 +0000 |
| Subject: | note 40948 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67090@lists.php.net to get a copy of this message | ||
Be aware that the following won't work as expected:
<?php
$text = "Hello web people";
str_replace("web", "tall", $text);
echo $text //outputs Hello web people
?>
You need to make sure to overwrite the variable...
<?php
$text = "Hello web people";
$text = str_replace("web", "tall", $text);
echo $text //outputs Hello tall people
?>
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40948
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40948&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40948&report=yes
Search -- http://master.php.net/manage/user-notes.php