#44538 [Opn->Fbk]: str_replace does not work for some regular expressions
ID: 44538
Updated by: felipe@php.net
Reported By: andre dot thompson at sta dot uwi dot edu
-Status: Open
+Status: Feedback
-Bug Type: *Regular Expressions
+Bug Type: Strings related
Operating System: Windows 2003 Server Standard
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Works fine to me on 5.2.6.
Previous Comments:
------------------------------------------------------------------------
[2008-03-26 16:29:57] andre dot thompson at sta dot uwi dot edu
Description:
------------
str_replace does not replace with more than one space.
Reproduce code:
---------------
$repstr = "', W";
$astring = "UPDATE Assets SET Supplier = '6', WHERE AssetID = '112'";
$update1 = str_replace($repstr, "' W", $astring);
echo $update1;
Expected result:
----------------
UPDATE Assets SET Supplier = '6' WHERE AssetID = '112'
Actual result:
--------------
UPDATE Assets SET Supplier = '6' WHERE AssetID = '112'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44538&edit=1
Thread (3 messages)