reverse loop for date display
Posted
by Michael
on Stack Overflow
See other posts from Stack Overflow
or by Michael
Published on 2010-04-08T12:34:59Z
Indexed on
2010/04/08
12:43 UTC
Read the original article
Hit count: 258
php
Hi,
I've been trying to figure this out, and can't seem to get it
Here is the code..
$m= date("m");
$de= date("d");
$y= date("Y");
for($i=0; $i<=6; $i++){
echo "<br>";
echo date('m/d',mktime(0,0,0,$m,($de+$i),$y));
echo "<br>";
}
That displays this
04/08
04/07
04/06
04/05
04/04
04/03
04/02
That is exactly what I want but I want it to flip around so echos it would like this
04/02
04/03
04/04
04/05
04/06
04/07
04/07
How would I do this?
Thank you in advance!
© Stack Overflow or respective owner