Current Location: Home> Function Categories> array_values

array_values

Return all values ​​in the array
Name:array_values
Category:Array
Programming Language:php
One-line Description:Returns all values ​​in the array.

Definition and usage

array_values() function returns an array containing all key values ​​in a given array, but does not retain the key names.

Tip: The returned array will use a numeric key, starting from 0 and incrementing by 1.

Example

Returns all values ​​of the array (non-key names):

 <?php
$a = array ( "Name" => "Bill" , "Age" => "60" , "Country" => "USA" ) ;
print_r ( array_values ​​( $a ) ) ;
?>

Try it yourself

grammar

 array_values ​​( array )
parameter describe
array Required. Specify array.
Similar Functions
Popular Articles