|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1998-10-26 12:12 UTC] peter dot lerner at bayreuth dot baynet dot de
the following code snippet ...
echo "string = \"" . $string . "\"<br>\n";
eregi_replace("!", " ", $string);
echo "string = \"" . $string . "\"<br>\n";
... yields this result:
string = "con ! air"
string = "con ! air"
did i miss something, or is this bad behaviour?
the "!" should have been replaced by <space>.
same with ereg_replace().
ups ... should read doku more thoroughly. must assign ereg_replace()
result. ;-) sorry.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 12:00:01 2025 UTC |
These functions do not modify the argument string. They return the new string. To make the above work, use: $string = eregi_replace("!"," ",$string); Note though that if you just want to change a single character you are better off using strtr().