For example given code:
if(strstr($key, ".")){
// do something
}
strstr returns a string, how can it be used as boolean? How does it turn true or false?
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.
Citing from the PHP docu:
So the boolean check is basically, whether the substring (the
.in this case) is found at all.Any other value this function can return is a non-empty string, which will be evaluated to truthy (See this entry in docu.)