array_keys

array_keys -- Return all the keys of an array

Description

array array_keys(array input);

array_keys() returns all the keys, numeric and string, from the input array.

Example 1. array_keys() example

$array = array(0 => 100, "color" => "red");
array_keys($array);    // returns array(0, "color")
      

See also array_values().

Note: This function was added in PHP 4.0.