array_key_exists -- Checks if the given key or index exists in the array
Syntax
bool array_key_exists ( mixed key, array search )
array_key_exists() returns TRUE if the
given key is set in the array.
key can be any value possible
for an array index. array_key_exists() also works
on objects.
Example 1. array_key_exists() example
<?php $search_array = array('first' => 1, 'second' => 4); if (array_key_exists('first', $search_array)) { echo "The 'first' element is in the array"; } ?>
Note:
The name of this function is key_exists()
in PHP 4.0.6.
array key exists php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online
Php array key exists syntax tutorial
php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.