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

PHP list() 函数_PHP教程

WBOY
發布: 2016-07-13 17:44:27
原創
818 人瀏覽過

$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...
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板