PHP list() 函数
来源:网络 责任编辑:栏目编辑 发表时间:2013-07-02 06:18 点击:次
<?php
$my_array = array("Dog","Cat","Horse");
list($a, $b, $c) = $my_array;
echo "I have several animals, a $a, a $b and a $c.";
?>
输出:
I have several animals, a Dog, a Cat and a Horse.
例子 2
<?php
$my_array = array("Dog","Cat","Horse");
list($a, , $c) = $my_array;
echo "Here I only use the $a and $c variables.";
?>
输出:
Here I only use the Dog and Horse variables.
相关新闻>>
- 发表评论
-
- 最新评论 更多>>