array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.array-values.php', 1 => 'array_values', 2 => 'Return all the values of an array', ), 'up' => array ( 0 => 'ref.array.php', 1 => 'Функції для роботи з масивами', ), 'prev' => array ( 0 => 'function.array-unshift.php', 1 => 'array_unshift', ), 'next' => array ( 0 => 'function.array-walk.php', 1 => 'array_walk', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/array/functions/array-values.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

array_values

(PHP 4, PHP 5, PHP 7, PHP 8)

array_valuesReturn 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.

Параметри

array

The array.

Значення, що повертаються

Returns an indexed array of values.

Приклади

Приклад #1 array_values() example

<?php
$array
= array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>

Поданий вище приклад виведе:

Array
(
    [0] => XL
    [1] => gold
)

Прогляньте також