<?php
/**
* 循环结构: for
* for (初始条件; 结束条件; 更新条件) { 循环体 }
*/
for ($i=0; $i<10; $i++) {
// print($i.',');
// print($i);
// if ($i < 9) {
// print(',');
// }
($i<9) ? print($i.',') : print($i);
}点击 "运行实例" 按钮查看在线实例
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号