Loop in PHP Using For (Descending)





13
Date Submitted Mon. Sep. 18th, 2006 5:13 AM
Revision 1 of 1
Helper nothingless
Tags forcodegrrl | PHP
Comments 3 comments
For those times you need to do a loop in PHP, but have the outcome be in descending order (ie, start at 10 and end at 1).


$totalcode="10";
for($i=$totalcode; $i>0; $i--){

 echo"$i";
}


 

Comments

Comments Special
Mon. Sep. 18th, 2006 5:25 AM    Syntax Master sundaramkumar
  Comments Pft
Wed. Sep. 20th, 2006 7:51 AM    Helper nothingless
    Comments er... silly
Tue. Oct. 10th, 2006 12:11 AM    Helper jarfil

Voting