List () assigns a set of variables in one-step operation. List () can only be used for arrays of numeric indexes and assumes that the numeric index starts at 0.
For example
$result = Mssql_query ("Select User, Sex, age from _user", $conn);
List ($user, $sex, $age) = Mssql_fetch_row ($result);
Echo $user.
;
Echo $sex.
;
Echo $age;
You can also assign a value to an array:
$hotcity = Array (Jinan, Qingdao, Zibo);
List ($addr [0], $addr [1], $addr [2]) = $hotcity;
Var_dump ($ADDR);
?>
Output:
Array (3) {[2]=> string (4) "Zibo" [1]=> string (7) "Qingdao" [0]=> string (5) "Jinan"}
http://www.bkjia.com/PHPjc/478757.html www.bkjia.com true http://www.bkjia.com/PHPjc/478757.html techarticle list () assigns a set of variables in one-step operation. List () can only be used for arrays of numeric indexes and assumes that the numeric index starts at 0. For example $result = Mssql_query ("Select User, Sex, Ag ...