foreach遍历数组
程序员文章站
2022-04-24 14:38:27
...
无详细内容 无 ?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."
"; } ?>