PHP array_values () function
Examples
Returns an array of all the values (not retained key name):
<?php
$a=array("Name"=>"Peter","Age"=>"41","Country"=>"USA");
print_r(array_values($a));
?>
$a=array("Name"=>"Peter","Age"=>"41","Country"=>"USA");
print_r(array_values($a));
?>
Running instance »
Definition and Usage
array_values () function returns an array containing all the values in the array.
Note: The returned array will use the numeric keys, starting at 0 and is incremented by 1.
grammar
array_values( array )
参数 | 描述 |
---|---|
array | 必需。规定数组。 |
technical details
return value: | It returns an array of all the values in the array. |
---|---|
PHP version: | 4+ |
Complete PHP Array Reference