|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-24 16:12 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 06:00:02 2025 UTC |
Description: ------------ When using str_replace with 2 arrays and 1 of them contains URL-s the result gets messed up. I provided a code snippet which shows it. Reproduce code: --------------- <?php $str='I love a b c'; $array0=array('a','b','c'); $array1=array('http://www.example.com/1.html','http://www.example.com/2.html','http://www.example.com/3.html'); echo str_replace($array0, $array1, $str); ?> Expected result: ---------------- I love http://www.example.com/1.html http://www.example.com/2.html http://www.example.com/3.html Actual result: -------------- I love http://www.example.http://www.example.com/3.htmlom/1.html http://www.example.http://www.example.com/3.htmlom/2.html http://www.example.com/3.html