一个简单的php问题,如何让echo的结果10个为一行的换行啊,谢谢!

<?php for ($cnt = 1; $cnt <=100; $cnt++){ echo $cnt; if ($cnt == 100){break;} echo ","; } ?>
2025-01-02 07:53:03
推荐回答(1个)
回答1:

for ($i = 1; $i <=100; $i++){
if($i%10==0){
echo $i."
";
} else{
echo $i.",";
}
}