php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44538 str_replace does not work for some regular expressions
Submitted: 2008-03-26 16:29 UTC Modified: 2008-04-03 01:00 UTC
From: andre dot thompson at sta dot uwi dot edu Assigned:
Status: No Feedback Package: Strings related
PHP Version: 5.2.5 OS: Windows 2003 Server Standard
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-03-26 16:29 UTC] 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'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-26 16:50 UTC] 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:52 UTC] scottmac@php.net
Web browser flatten multiple spaces down to one. If you run this via the command line it would show correctly.
 [2008-04-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Aug 19 09:05:50 2022 UTC