|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-02-10 04:17 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2015-02-10 04:17 UTC] requinix@php.net
[2015-02-10 09:49 UTC] slevy1 at pipeline dot com
[2015-02-10 10:24 UTC] nikic@php.net
-Status: Not a bug
+Status: Re-Opened
[2015-02-10 10:24 UTC] nikic@php.net
[2015-02-10 10:27 UTC] nikic@php.net
-Status: Re-Opened
+Status: Not a bug
[2015-02-10 10:27 UTC] nikic@php.net
[2015-02-10 11:06 UTC] requinix@php.net
[2015-02-10 21:09 UTC] slevy1 at pipeline dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 13:00:01 2025 UTC |
Description: ------------ If I provide strtr a from value like a comma, and a to value like an empty string, since the from value is longer than the to value, the translation fails to occur. However, if I provide the from and to values in an associative array, then the comma in the from value is replaced by an an empty string in the to value. Test script: --------------- <?php $nums = "1,2,3,\n,4,5,6,\n,7,8,9"; echo strtr($nums,array("," => "")); echo "\n\n"; echo strtr($nums,",",""); Expected result: ---------------- 123 456 789 123 456 789 Actual result: -------------- 123 456 789 1,2,3, ,4,5,6, ,7,8,9