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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andre dot thompson at sta dot uwi dot edu
New email:
PHP Version: OS:

 

 [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: Wed Aug 17 17:05:44 2022 UTC