时间:2021-07-01 10:21:17 帮助过:2人阅读
基本语法:
array array_values ( array $input )
array_values() 返回 input 数组中所有的值并给其建立数字索引。
参数介绍:
返回值:
返回含所有值的索引数组。
注意:
返回的新数组的所有将使用数字索引,从0开始。
实例:
- <?php
- $array = array(
- "php" => "php code",
- "html" => "html code",
- "css" => "css code",
- "js" => "js code",
- );
- print_r(array_values($array));
- ?>
运行结果:
Array ( [0] => php code [1] => html code [2] => css code [3] => js code )