📜  php: foreach 循环 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:41.202000             🧑  作者: Mango

代码示例1
Copyfor($i = 0; $i < 5; $i++){
     echo $i;
}

$luckyNums = [4, 8, 15, 16, 23, 42];
foreach($luckyNums as $luckyNum){
     echo $luckyNum."
"; }