Sunday, February 9, 2014

PHP: How to check if key exists in array

php manual:

array_key_exists

(PHP 4 >= 4.0.7, PHP 5)
array_key_exists — Checks if the given key or index exists in the array

Description ¶

bool array_key_exists ( mixed $key , array $array )
array_key_exists() returns TRUE if the given key is set in the array. key can be any value possible for an array index.


No comments:

Post a Comment