PHP array_keys() Function

The array_keys() function is used to get all the keys or a subset of the keys of an array.

Example -

Note: If the optional search_key_value is specified, then only the keys for that value are returned. Otherwise, all the keys from the array are returned.

Example -