asked on
ASKER
ASKER
ASKER
ASKER
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER
In that situation it gives this error: Fatal error: Call to undefined function getpreviousweekday() . Here is the complete script that I'm testing:
<?php
$inputDate = "March, 2007";
list($inputMonth, $inputYear) = explode(', ', $inputDate);
$daysInMonth = date('t', strtotime("$inputMonth $inputYear"));
for ($i=1; $i<=$daysInMonth; $i++)
{
if (6 > date('N', strtotime("$i $inputMonth $inputYear")))
{
$weekday = date('mdy', strtotime("$i $inputMonth $inputYear"));
//////////// Get previous weekday /////////
$inputMonth = substr($weekday, 0, 2);
$inputDay = substr($weekday, 2, 2);
$inputYear = substr($weekday, 4, 2);
$timestamp = mktime(0, 0, 0, $inputMonth, $inputDay, $inputYear);
getPreviousWeekday($timest
function getPreviousWeekday($timest
// This function is called recursively until a weekday is found
$previousDay = $timestamp - 86400; // Substract one day of seconds (24 hours x 60 minutes x 60 seconds)
if (6 > date('N', $previousDay)) {
$previousWeekday = date('mdy', $previousDay);
print "$previousWeekday<br />";
} else {
getPreviousWeekday($previo
}
}
/////// END of get previous weekday //////////
echo "<tr><td>$weekday $previousweekday</td></tr>
}
}
?>