-
Notifications
You must be signed in to change notification settings - Fork 14
in_array
Chung Leong edited this page Jan 10, 2022
·
3 revisions
in_array - Checks if a value exists in an array
bool in_array ( mixed $needle, array $haystack )
in_array() searches haystack for needle.
needle - The searched value. If haystack is a one-dimensional array, then needle should be a scalar. If haystack is a multi-dimensional array, then needle of should be an array of the same size as the subarrays of haystack. The size of needle must be known at compile-time. It cannot be an expandable array.
haystack - The array to perform the search on.
true if needle is found in the array and false otherwise.
1.0 and above.