- <?php
- $player=array("xiaoliu","lee","wang","zhang");
- reset($player);
- print_r (each($player));
- echo '<br>';
- while (list($k,$v)=each($player)){
- print_r($k."--".$v) ;
- echo "<br>";
- }
- /*
- * each返回当前位置的 关键字/值对的数组
- * 第一次的时候print_r打印:
- *Array ( [1] => xiaoliu [value] => xiaoliu [0] => 0 [key] => 0 )
- */
- ?>
list和each遍历数组
最新推荐文章于 2020-04-03 15:02:13 发布