0

我将如何从 50 开始选择?

$i_season=1; $i_season<=50; $i_season++
4

3 回答 3

3

试试这个

<?php 

    for($i_season=50; $i_season>=1; $i_season--)
    {
        // to write your code
        echo $i_season;
    }
?>

或者也试试下面的代码

<?php 

    $i_season=50;
    while($i_season!= 0)
    {
        // to write your code
        echo $i_season;
        $i_season--;
    }
?>
于 2012-04-26T11:07:15.967 回答
1
$i_season=50; $i_season>=1; $i_season--
于 2012-04-26T11:01:20.603 回答
1

你也可以用另一种方式(慢)

<?php 
$seasons = range(50,1);

foreach ($seasons as $season) {
    echo $season."<br/>";
}
?>
于 2012-04-26T11:11:57.527 回答