English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The array_values() function returns all values in the array
array_values($array);
This function takes input fromarray Returns all values and array Perform numeric indexing.
Returns an index array containing all values.
Serial Number | Parameters and Description |
---|---|
1 | array (required) It specifies an array. |
Use array_values to get all values of an array and use numbers starting from 0 as indices
<?php $input = array("a"=>"green", "b"=>"brown", "c"=>"blue", "red"); print_r(array_values($input)); ?>Test and see‹/›
Output Result:
Array ( [0] => green [1] => brown [2] => blue [3] => red )