BOOL In_array (mixed needle, array haystack [, BOOL strict])
Searches for needle in haystack and returns TRUE if found, otherwise FALSE.
If the value of the third parameter strict is TRUE then the In_array () function also checks whether the needle type is the same as in haystack.
Note: If needle is a string, the comparison is case-sensitive.
Note: Needle is not allowed to be an array until PHP version 4.2.0.
Example 1. In_array () example
$os = Array ("Mac", "NT", "Irix", "Linux");
if (In_array ("Irix", $os)) {
Print "Got Irix";
}
if (In_array ("Mac", $os)) {
Print "Got mac";
}
http://www.bkjia.com/PHPjc/632396.html www.bkjia.com true http://www.bkjia.com/PHPjc/632396.html techarticle bool In_array (mixed needle, array haystack [, bool strict]) searches for haystack in needle and returns TRUE if found, otherwise FALSE. If the value of the third parameter strict is ...