Determines whether a number is a function in a known array.
Source: Internet
Author: User
Boolin_array (mixedneedle, arrayhaystack [, boolstrict]) searches for needle in haystack. If yes, TRUE is returned. otherwise, FALSE is returned. If the value of the third parameter strict is TRUE, the in_array () function checks whether the needle type is consistent with h bool in_array (mixed needle, array haystack [, bool strict]).
Search for needle in haystack. If yes, TRUE is returned. otherwise, FALSE is returned.
If the value of the third strict parameter is TRUE, the in_array () function checks whether the needle type is the same as that in haystack.
Note: If needle is a string, the comparison is case sensitive.
Note: Before PHP version 4.2.0, needle cannot be an array.
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 ";
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.