首頁 >後端開發 >php教程 >PHP list() 函数_PHP教程

PHP list() 函数_PHP教程

WBOY
WBOY原創
2016-07-13 17:44:27821瀏覽

$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
$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.

www.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...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn