Home  >  Article  >  Backend Development  >  What is php array key

What is php array key

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-09-28 13:51:423543browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn