2009年4月19日星期日

i3原创: php 常用数组操作函数

1 . array_values() 取数组值:
例子:
$array = array("size" => "XL", "color" => "gold");
print_r(array_values($array));
?>

The above example will output:

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

--------------------------
2. array_keys() 取数组键值
例子:
$array = array(0 => 100, "color" => "red");
print_r(array_keys($array));

$array = array("blue", "red", "green", "blue", "blue");
print_r(array_keys($array, "blue"));
he above example will output:

Array
(
[0] => 0
[1] => color
)
Array
(
[0] => 0
[1] => 3
[2] => 4
)






-------------------------------------------
i3server
i3server
www.86-00.com

没有评论: