SoFunction
Updated on 2025-04-09

php array_values ​​Returns the detailed explanation of the value instance of the array

array_values ​​Return all values ​​in the array

Basic syntax:

array array_values ( array $input )

array_values() Returns all values ​​in the input array and indexes them numerically.

Parameter description:

parameter describe
input Required. Specify array.

Return value:

Returns an index array with all values.

Notice:

All returned new arrays will be indexed using numericals starting at 0.

Example:

<?php
$array = array(
 "php" => "php code",
 "html" => "html code",
 "css" => "css code",
 "js" => "js code",
);
print_r(array_values($array));
?>  

Running results:

Array ( [0] => php code [1] => html code [2] => css code [3] => js code )

Thank you for reading, I hope it can help you. Thank you for your support for this site!