Hiya, I am totally new to PHP and am trying to get PHP to pass the date 1 week ahead to Flash, I have managed to get the current date and also to set up a loop from the PHP file that loops through x working days ahead but all i want is the date 1 week ahead. Here is the code I am using now:
<?php
$how_many_business_days_ahead = 0;
$how_many_business_days_to_count = 8;
for ($i=0;$i<$how_many_business_days_to_count;$i++)
{
$jump=$i+$how_many_business_days_ahead;
$evalday = mktime(strftime ("%d/%m/%Y", strtotime("+$jump days")));
$theday = strftime("%A", strtotime("+$jump days"));
if($theday != "Saturday" and $theday != "Sunday")
{
$days = $how_many_business_days_ahead+$i;
$the_days[$j] = strftime("%A, %B %d, %Y", strtotime("+$jump days"));
$j++;
}
}
$k = $how_many_business_days_ahead;
foreach($the_days as $eachday)
{
echo "eachday= ".$eachday;
$k++;
}
?>
This is giving me this string in Flash:
Thursday, April 20, 2006eachday= Friday, April 21, 2006eachday= Monday, April 24, 2006eachday= Tuesday, April 25, 2006eachday= Wednesday, April 26, 2006eachday= Thursday, April 27, 2006
As I said I am totally new to PHP so if someone could let me know how to echo just the date to Flash as seperate variables (day, date, month, year) it would be a really big help.
I would like to send the date in this kind of form but for 7 days hence:
<?php
$date=date("d");
$day=date("D");
$month=date("M");
$year=date("Y");
$time=date("H:i");
echo "date=".$date."&time=".$time."&day=".$day."&month=".$month."&year=".$year;
?>
Thanks guys!