Func Array Keys
# PHP array_keys() Function
[Complete PHP Array Reference](#)
## Example
Returns a new array containing all the keys from the input array:
"XC90","BMW"=>"X5","Toyota"=>"Highlander");
print_r(array_keys($a));
?>
[Run Example Β»](#)
* * *
## Definition and Usage
The array_keys() function returns a new array containing all the keys from the input array.
* * *
## Syntax
array_keys(_array,value,strict_)
| Parameter | Description |
| :--- | :--- |
| _array_ | Required. Specifies the array. |
| _value_ | Optional. You can specify a value, then only the keys for that value will be returned. |
| _strict_ | Optional. Used with the value parameter. Possible values: * true - Returns keys with the specified value, depending on type. Number 5 is not the same as string "5". * false - Default value. Not dependent on type. Number 5 is the same as string "5". |
## Technical Details
| Return Value: | Returns a new array containing all the keys from the input array. |
| :--- |
| PHP Version: | 4+ |
| Changelog: | The _strict_ parameter was added in PHP 5.0. |
* * *
## More Examples
## Example 1
Using the value parameter:
"XC90","BMW"=>"X5","Toyota"=>"Highlander");
print_r(array_keys($a,"Highlander"));
?>
[Run Example Β»](#)
## Example 2
Using the strict parameter (false):
[Run Example Β»](#)
## Example 3
Using the strict parameter (true):
[Run Example Β»](#)
* * Complete PHP Array Reference](#)
YouTip