#How to get the value in the array in php?
array_values definition and usage
array_values() function returns an array containing all key values in the given array, but does not retain the key names.
Tip: The returned array will use numeric keys, starting at 0 and increasing by 1.
Syntax
array_values(array)
Parameters
array required. Specifies an array.
Return all values (non-key names) of the array:
<?php $a=array("Name"=>"Bill","Age"=>"60","Country"=>"USA"); print_r(array_values($a)); ?>
Output:
Array ( [0] => Bill [1] => 60 [2] => USA )
For more PHP knowledge, please visit PHP Chinese website!
The above is the detailed content of How to get the value in the array in php. For more information, please follow other related articles on the PHP Chinese website!