Over a million developers have joined DZone.

Loop In PHP Using For (Descending)

DZone's Guide to

Loop In PHP Using For (Descending)

Free Resource
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).

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


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}