HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

array_values

Description

The array_values of Array for PHP 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
)