php array_values 返回数组的所有值详解及实例 php array_values php array_values 函数用于返回数组中所有的值,注意该函数将为新数组建立数组索引,原来的文字索引将不存在。本文章向大家讲解array_values函数的基本语法及使用实例。 array_values 返回数组中所有的值 基本语法: array array_values ( array $input ) array_values() 返回 input 数组中所有的值并给其建立数字索引。 参数介绍: 参数 描述 input 必需。规定数组。 返回值: 返回含所有值的索引数组。 注意: 返回的新数组的所有将使用数字索引,从0开始。 实例: "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 ) 感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!