超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<array_unshiftarray_walk_recursive>
Last updated: Fri, 22 Jun 2007

array_values

(PHP 4 , PHP 5)

array_values -- 返回数组中所有的值

说明

array array_values ( array input)

array_values() 返回 input 数组中所有的值并给其建立数字索引。

例子 1. array_values() 例子

<?php
$array
= array ("size" => "XL", "color" => "gold");
print_r(array_values ($array));
?>

上例将输出:

Array
(
   [0] => XL
   [1] => gold
)

参见 array_keys()




add a note add a note User Contributed Notes
array_values
richard at phpguru dot org
20-Dec-2001 04:56
If you have a numerically indexed array with some keys missing, ie 1, 2, 4, 5 and you want to reindex it so it's 1,2,3,4 *without changing the positions of the values* (ie sort()) then you can use this function to do it.

<array_unshiftarray_walk_recursive>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22