#44538 [Fbk]: str_replace does not work for some regular expressions

From: Date: Wed, 26 Mar 2008 16:52:35 +0000
Subject: #44538 [Fbk]: str_replace does not work for some regular expressions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123673@lists.php.net to get a copy of this message
 ID:               44538
 Updated by:       scottmac@php.net
 Reported By:      andre dot thompson at sta dot uwi dot edu
 Status:           Feedback
 Bug Type:         Strings related
 Operating System: Windows 2003 Server Standard
 PHP Version:      5.2.5
 New Comment:

Web browser flatten multiple spaces down to one. If you run this via
the command line it would show correctly.


Previous Comments:
------------------------------------------------------------------------

[2008-03-26 16:50:22] felipe@php.net

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.

------------------------------------------------------------------------

[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)

« previous php.bugs (#123673) next »