|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-20 13:06 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 21:00:01 2025 UTC |
Description: ------------ preg_replace strips double backslashes from the second passed argument, but keeps all other backslashes Reproduce code: --------------- $var = "a\\\\b\\c\\\""; # this is a string a\\b\c\" $subj = "this is a {sample} text"; echo preg_replace("/\{sample\}/", $var, $subj); Expected result: ---------------- this is a a\\b\c\" text Actual result: -------------- this is a a\b\c\" text