Returns the keys of an array.
The array_keys() function returns an array with all the keys of another array. If the input array is not an associative array, the key array will contain the indexes. If the search parameter is used, only the keys of the elements equal to the search parameter will be returned.
<?php
$array1 = array(
"strawberry" => "red",
"blueberry" => "blue",
"raspberry" => "red");
// find red berries
foreach (array_keys($array1, "red") as $berry)
print "$berry ";
?>
strawberry raspberry
This example shows how array_keys can be used with the search parameter.