Daily Stats?
Posted: Wed May 21, 2003 11:28 pm
Hi guys!
I'm trying to wire a script that shows all the days since a certain day... Here is my code
Now what that will do is show 31 days since the 22 May 2003.
$dayshow = "0/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31";
How do I get it to show all the days since a certain day without having to manually do like above...
Do you understand?
Thanks!
I'm trying to wire a script that shows all the days since a certain day... Here is my code
Code: Select all
<?php
// How many days to show.... This is where my problem is...
$dayshow = "0/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31";
// Get rid of the / etc.
$dayshow = explode("/",$dayshow);
// Show the days
for ($i=0 ; $i <count($dayshow) ; $i++)
{
$start_date = "1053568267"; // 22 May 2003
$num = $dayshow[$i];
$days = $num*24*60*60;
$day = $start_date + $days;
$day = date($datetype, $day);
$day1 = strtotime($day);
echo "<a href="$day1">$day</a><br>\n";
}
?>$dayshow = "0/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31";
How do I get it to show all the days since a certain day without having to manually do like above...
Do you understand?
Thanks!