A very strange problem is php string judgment. I want to determine whether a string contains another character. I checked the manual and online. PHPcodevar_dump (strstr (coincidentally, outdoor hiking shoes); echo $ position; obviously not included, but the result is true & nbsp; int (8) why, solution ----------- a strange problem: php string judgment
I want to determine whether a string contains another character
I checked the manual and online documents.
PHP code
Var_dump (strstr ('qiao', 'Outdoor shoes hiking shoes '); echo $ position;
Obviously not included, but the result is true
Int (8)
Why?
------ Solution --------------------
Read the manual carefully to see the parameter location in the function.
Also, in this case, you convert to UTF-8 format and then compare,
------ Solution --------------------
GBK environment?
Clever internal code
C7c9
Internal code of outdoor hiking shoes
Bba7cde2d0acb5c7c9bdd0ac
That is, the second byte and the first byte of the mountain are exactly the same