why 3 backslash equal 4 backslash in php?
<?php $a='/\\\/'; $b='/\\\\/'; var_dump($a);//string '/\\/' (length=4) var_dump($b);//string '/\\/' (length=4) var_dump($a===$b);//boolean true ?> Why is the string with 3 backslashes equal to the string with 4 backslashes in PHP? And can we use the 3-backslash version in regular expression? The PHP reference says we must use 4 backslashes. Note: Single and double quoted PHP strings have special meaning of backslash. Thus if \ has to be matched with a regular expression \\ , then "\\\\" or '\\\\' must be used in PHP code. $b='/\\\\/'; php parses the string literal (more or less) character by