Soldato
- Joined
- 7 Jan 2007
- Posts
- 10,607
- Location
- Sussex, UK
If I wanted to run one script every week on a Saturday at 19:30 and again on Monday at 21:00 (for every week of the year) what is the command to do that?
$d=date("D");
if ($d=="Wed") {
$dayofweek = date('D', strtotime('next saturday'));
$day = date('d', strtotime('next saturday'));
$month = date('m', strtotime('next saturday'));
$year = date('Y', strtotime('next saturday'));
echo $dayofweek . $day . $month . $year;
} if ($d="Sat") {
$day = date('D', strtotime('next wednesday'));
$dayofweek = date('d', strtotime('next wednesday'));
$month = date('m', strtotime('next wednesday'));
$year = date('Y', strtotime('next wednesday'));
}
?>
Atleast it will cut my script files down by 66%
Shame about cron not being able to attribe to dates to it :/