Home Menu

array_values

Return all the values of an array

Syntax

array_values ( array $array ) : array

Parameters

array

The array.

Return

Returns an indexed array of values.

Examples

1

<?

$array = array(4 => "red", 10 => "green", 2 => "blue");

$return = array_values($array);

print_r($return);

?>
Array
(
    [0] => red
    [1] => green
    [2] => blue
)

2

<?

$array = array("size" => "XL", "color" => "gold", "model" => "prototype");

$return = array_values($array);

print_r($return);

?>
Array
(
    [0] => XL
    [1] => gold
    [2] => prototype
)

Internal

array_combine

array_merge

array_walk

External

PHP

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms