Php in_array function usage analysis, phpin_array. Php in_array function usage analysis, phpin_array This article analyzes the use of in_array function in php. Share it with you for your reference. Details: PHP is a weak type language IN the use of in_array function IN _ php Usage analysis, phpin_array
This article analyzes the in_array function usage in php. Share it with you for your reference. The details are as follows:
PHP is a weak language. when using the IN_ARRAY function, try to include the third parameter. the code is as follows:
The code is as follows:
Var_dump (in_array (0, array ('s', 'SS'), true); // return false
Var_dump (in_array (0, array ('s', 'SS'); // return true
Var_dump (in_array (0, array (1, 2, 3); // return false
From the above three functions, we can see that when the first one is in_array (0, array ('s', 'SS'), true), the returned value is the value we want.
Usage:
The code is as follows:
Var_dump (in_array (0, array ('s', 'SS ')));
And:
The code is as follows:
Var_dump (in_array (0, array (1, 2, 3 )));
The returned ture is obviously not the value we need, because PHP is the weak type, so you should pay attention to it before.
I hope this article will help you with php programming.
In this article, we analyze the in_array function usage in php. Share it with you for your reference. The details are as follows: PHP is a weak language that uses IN _...