strange preg_quote behavior
问题 I have this code <?php $a = "\\u0000"; $b = preg_quote($a); echo "<br />my own: ".$a; echo "<br />with preg_quote:". $b; ?> result is here How is possible that one \ character vanished from my $a variable? I think it's very begginer behavior/question but I'm really lost about these escape characters. Disclaimer: I'm not begginer in PHP 回答1: because \ escapes the next one, as every \ needs to be escaped. with a single \ it escapes the next character witch is u, but \u isn't a char code so it