php对于类似$age = array(“zhangshan”=>14,”lisi”=>15,”sharejs”=>16);这样的数组可以通过foreach的方法进行遍历,下面是详细的代码
$age = array("zhangshan"=>14,"lisi"=>15,"sharejs"=>16); foreach($age as $name=>$value){ echo $name . "=" . $value; echo "\n"; }
php对于类似$age = array(“zhangshan”=>14,”lisi”=>15,”sharejs”=>16);这样的数组可以通过foreach的方法进行遍历,下面是详细的代码
$age = array("zhangshan"=>14,"lisi"=>15,"sharejs"=>16); foreach($age as $name=>$value){ echo $name . "=" . $value; echo "\n"; }