(PHP 4, PHP 5, PHP 7, PHP 8)
array_values — Return all the values of an array
array_values(array $array): array
array_values() returns all the values from the array and indexes the array numerically.
arrayThe array.
Returns an indexed array of values.
Example #1 array_values() example
<?php
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?> The above example will output:
Array
(
[0] => XL
[1] => gold
)
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/function.array-values.php