时间:2021-07-01 10:21:17 帮助过:23人阅读
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
$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.
http://www.bkjia.com/PHPjc/478745.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478745.htmlTechArticle?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...