array_values() 函數用于返回數組中所有的值,并返回一個包含數組中所有值的新數組。
語法:
array_values(array)
參數:
示例:
<?php $colors = array("red", "green", "blue"); print_r(array_values($colors)); ?>
輸出:
Array ( [0] => red [1] => green [2] => blue )