foreach遍历数组
程序员文章站
2022-05-15 10:17:41
...
无详细内容 无 ?php/* * foreach */ $fruits = array("lemon" , "orange" , "banana" , "apple");sort($fruits);$n = count($fruits);echo "Length of fruits is: ".$n."br/";foreach ($fruits as $key = $val) { echo "fruits[".$key."] = ".$val."br/";} ?
"; foreach ($fruits as $key => $val) { echo "fruits[".$key."] = ".$val."
"; } ?>