Someone could tell me why preg_replace eat a slash when it do replacement?
<?
$stringToReplac e = "blah blah {nome} blah blah";
$replacement = "Two slash: \\\\";
$stringToReplac e =
preg_replace("/{nome}/Us",$replacemen t,$stringToRepl ace,1);
echo($stringToR eplace);
#
# It print
# blah blah Two slash: \ blah blah
#
# instead of
# blah blah Two slash: \\ blah blah
#
# Why it eat a slash?
#
?>
<?
$stringToReplac e = "blah blah {nome} blah blah";
$replacement = "Two slash: \\\\";
$stringToReplac e =
preg_replace("/{nome}/Us",$replacemen t,$stringToRepl ace,1);
echo($stringToR eplace);
#
# It print
# blah blah Two slash: \ blah blah
#
# instead of
# blah blah Two slash: \\ blah blah
#
# Why it eat a slash?
#
?>
Comment