It seems that PHP's === operator is case sensitive. So is there a reason to use strcmp()?
===
strcmp()
Is it safe to do something like the following?
if ($password === $password2) { ... }
The reason to use it is because strcmp
strcmp
returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
=== only returns true or false, it doesn't tell you which is the "greater" string.
true
false
2.1m questions
2.1m answers
60 comments
57.0k users