Return all values in the array (keys are not retained):
<?php$a=array("Name"=>"Peter","Age"=>"41","Country"=>"USA");print_r(array_values($a));?>The array_values() function returns an array containing all the values in the array.
Tip: The returned array will use numeric keys, starting at 0 and increasing by 1.
array_values( array )
parameter | describe |
---|---|
array | Required. Specifies an array. |
Return value: | Returns an array containing all the values in the array. |
---|---|
PHP version: | 4+ |