note 52969 added to function.str-replace
| From: | klubov at mail dot ru | Date: | Thu, 19 May 2005 08:27:35 +0000 |
| Subject: | note 52969 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89618@lists.php.net to get a copy of this message | ||
Why this example will output " b a " instead of " b b "?
<?php
$search = " a ";
$replace = " b ";
$subject = " a a ";
echo str_replace($search, $replace, $subject);
?>
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52969
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52969&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52969&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52969&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52969&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52969&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52969&report=yes
Search -- http://master.php.net/manage/user-notes.php