got a quick question about finding specific days. I have a script that I need to run on the second Friday of each month and since I can’t do it without editing a file on the server (don’t have access to the file), I have to find a way to do it through php. The best i can do is have it run every Friday. But that’ll lead another issue once the import script kicks in.
This is what I have so far[php]$fom = mktime(0, 0, 0, $month, 1, $year);
$secfri = strtotime(date(‘m/d/Y’, $fom), ‘+7 days’);
$curdate = strtotime(date(‘m/d/Y’));
if($secfri == $curdate) {
for($i=0; $i < count($command); $i++) {
exec($command[$i], $out, $err);
}
if(isset($out)) {
foreach ($out as $line) {
echo "$line\r\n";
}
} else {
foreach ($err as $line) {
echo "$code: $line\r\n";
}
}
}[/php]What i’m not sure how php calculates an offset, whether it counts the current date or if it moves to the next day. each Friday is 7 days from the previous Friday, so i’m thinking what I have should work.