我正在试图弄清楚如何生成以逗号分隔的x数字,并在变量($ total_days_month)中定义最大限制。
<?php
$total_days_month = date('t'); // get total days of this month
// generate numbers separated with comma from 1 until $total_days_month
?>
答案 0 :(得分:2)
echo implode(',', range(1, $total_days_month));