Logo

Programming-Idioms

History of Idiom 12 > diff from v17 to v18

Edit summary for version 18 by :

Version 17

2015-08-22, 06:56:39

Version 18

2015-08-26, 14:54:47

Idiom #12 Check if list contains a value

Check if list contains a value x.
list is any iterable finite container.

Idiom #12 Check if list contains a value

Check if list contains a value x.
list is any iterable finite container.

Code
in_array ( $x, $list, true );
Code
in_array ($x, $list, true);
Comments bubble
/* in_array returns true if value exists in array $list */

/* last argument should be set to true. Otherwise unexpected behavior is very likely to happen, for details see php manual */
Comments bubble
/* in_array returns true if value exists in array $list */

/* last argument should be set to true. Otherwise unexpected behavior is very likely to happen, for details see php manual */