Menu Riverview Church

IN_ARRAY

Checks if a value exists in an array

SYNTAX

in_array ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : bool

PARAMETERS

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 types of the needle in the haystack.

RETURN

Returns TRUE if needle is found in the array, FALSE otherwise.

EXAMPLES

NEEDLE HAYSTACK

true

STRICT

false

1

Linux

2

5.6

3

php
o

4

loose:
11111 11111

strict:
11111

PHP