in_array()
in_array - Checks if a value exists in an array
Syntax
bool in_array (
mixed $needle,
array $haystack,
bool $strict)
Arguments
- needle - The searched value. Note: If needle is a string, the comparison is done in a case-sensitive manner.
- haystack - The array.
- strict - If the third parameter strict is set to TRUE then the in_array() function will also check the typesof the needle in the haystack.
Description
Searches haystack for needle.
Version
PHP 4, 5
Return value
Returns TRUE if needle is found in the array, FALSE otherwise.