Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP array_values() Function

PHP array_values() Function

PHP Array ReferenceComplete PHP Array Reference Manual

Example

Return all the values of an array (keys are not preserved):

"Peter","Age"=>"41","Country"=>"USA"); print_r(array_values($a)); ?>

Run Example »


Definition and Usage

The array_values() function returns an array containing all the values of an array.

**Tip:** The returned array will use numeric keys starting at 0 and increasing by 1.


Syntax

array_values(

array

)

Parameters Description
array Required. Specifies the array.

Technical Details

Return Value: Returns an array containing all the values of the array.
PHP Version: 4+

PHP Array ReferenceComplete PHP Array Reference Manual