Can anyone tell me what is happening here?
<?php
// true
var_dump('\\ ' === '\ ');
// false
var_dump('\\\\ ' === '\\ ');
// true
var_dump('\\\\ ' === '\\\ ');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
\inside a string literal introduces several types of escape sequences,\\is the escape sequence for a literal “\”. But,\s that don’t resolve to an escape sequence are also taken as literal “\”.Therefor,
'\\ 'stands for the string “\ “,'\\\\ 'stands for the string “\\ “, just as'\\\ '. Try:See http://php.net/manual/en/language.types.string.php#language.types.string.syntax.single.