array_keys and array_key_exists
array_keys
This function will return all the keys of an array.
For example
$arr = array(”one”=>,”two”=>2,”three”=>3)
$temp = array_keys($arr);
print_r($arr);
Now the temporary array will contain
Array ( [0] => one [1] => two [2] => three )
$arr = array(”one”=>,”two”=>2,”three”=>3)
array_key_exists
This function is used to check whether array key is exists or not
Example
$arr = array(”one”=>1,”two”=>2,”three”=>3);
echo $temp = array_key_exists(”one”,$arr);
echo $temp = array_key_exists(”one1″,$arr);
First echo will print 1 because key one is exists in the array.And also second will print nothing because key one1 is not exists in the array.
