array_values

(PHP 4, PHP 5, PHP 7)
Return all the values of an array
array array_values ( array $array )

array_values() returns all the values from the array and indexes the array numerically.

Parameters:
array

The array.

Returns:

Returns an indexed array of values.

Examples:
array_values() example
1
2
3
4
<?php
$array array("size" => "XL""color" => "gold");
print_r(array_values($array));
?>

The above example will output:

Array
(
    [0] => XL
    [1] => gold
)
See also:

array_keys() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.