Home>Article>Backend Development> Scared to think about it? About the third parameter of in_array
Usein_array ()
Determine whether there is a certain value in the array. If the third parameter is omitted, sometimes the result may be meaningless...
For example, the following Code snippet:
Changed to
in_array('Hello', $arr, true)
This problem can be solvedThis problem does not exist in JS, for example, use The indexOf () function can be rewritten like this
I don’t know if this question will make you fall into silence→_→
Related recommendations: "PHP video tutorial》
The above is the detailed content of Scared to think about it? About the third parameter of in_array. For more information, please follow other related articles on the PHP Chinese website!