array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.array-values.php', 1 => 'array_values', ), 'up' => array ( 0 => 'ref.array.php', 1 => 'Array Functions', ), 'prev' => array ( 0 => 'function.array-unshift.php', 1 => 'array_unshift', ), 'next' => array ( 0 => 'function.array-walk-recursive.php', 1 => 'array_walk_recursive', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/array/functions/array-values.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
array_values — Return all the values of an array
array_values() returns all the values from the
array
and indexes the array numerically.
array
The 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 )