我如何获得年数之间的年份
$starting_year=2016;
$ending_year=2020;
for ($x = $starting_year; $x < $ending_year; $x++) {
echo "$x <br />";
}
当前输出
2016
2017
2018
2019
期望的输出
2017
2018
2019
答案 0 :(得分:1)
试试这个 -
<?php
$starting_year=2016;
$ending_year=2020;
for ($x = $starting_year+1; $x < $ending_year; $x++) {
echo "$x <br />";
} ?>