<?php $arr = array("id"=>01,"name"=>"zhangsan","addr"=>"shanghai"); $aa = each($arr); print_r($aa); /*Array ( [1] => 1 [value] => 1 [0] => id [key] => id ) */ list($key,$val) = $aa; while(list($key,$val) = each($arr)){ echo $key."-->".$val."<br/>"; } echo "<hr/>"; reset($arr);//reset恢復指針從0開始 while(list($key,$val)= each($arr)){ echo $key."-->".$val."<br/>"; } /* id-->1 name-->zhangsan addr-->shanghai */ ?>