list
(PHP 3, PHP 4, PHP 5)list --  把数组中的值赋给一些变量 
说明
void list ( mixed varname, mixed ... )
像 array() 一样,这不是真正的函数,而是语言结构。list() 用一步操作给一组变量进行赋值。 注: list() 仅能用于数字索引的数组并假定数字索引从 0 开始。 例子 1. list() 例子<?php$info = array('coffee', 'brown', 'caffeine');// Listing all the variables
list($drink, $color, $power) = $info;
echo "$drink is $color and $power makes it special.\n";// Listing some of them
list($drink, , $power) = $info;
echo "$drink has $power.\n";// Or let's skip to only the third one
list( , , $power) = $info;
echo "I need $power!\n";?>  
 
例子 2. 使用 list() 的例子<table>
 <tr>
  <th>Employee name</th>
  <th>Salary</th>
 </tr><?php$result = mysql_query("SELECT id, name, salary FROM employees",$conn);
while (list($id, $name, $salary) = mysql_fetch_row($result)) {
    echo " <tr>\n".
         "  <td><a href=\"info.php?id=$id\">$name</a></td>\n".
         "  <td>$salary</td>\n".
         " </tr>\n";
}?></table>