Home > Article > Backend Development > What is php array key
array_keys() function returns a new array containing all the keys in the array.
Grammar
array_keys(array,value,strict)
Related recommendations:《php array》
Example
Return a new array containing all the key names in the array:
<?php $a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander"); print_r(array_keys($a)); ?>
Running result:
Array ( [0] => Volvo [1] => BMW [2] => Toyota )
The above is the detailed content of What is php array key. For more information, please follow other related articles on the PHP Chinese website!