$cur_time) { return $next_time; } if ($min == '*' && $hour == '*' && $wday == '*' && $mday == '*' && $mon == '*') { list ($nex_min, $nex_hour, $nex_mday, $nex_mon, $nex_year) = explode (" ", date ("i H d m Y", $next_time + SECONDS_1MINUTE)); } else if ($hour == '*' && $wday == '*' && $mday == '*' && $mon == '*') { list ($nex_min, $nex_hour, $nex_mday, $nex_mon, $nex_year) = explode (" ", date ("i H d m Y", $next_time + SECONDS_1HOUR)); } else if ($mday == '*' && $mon == '*') { list ($nex_min, $nex_hour, $nex_mday, $nex_mon, $nex_year) = explode (" ", date ("i H d m Y", $next_time + SECONDS_1DAY)); } else if ($mon == '*') { $nex_mon = $nex_mon + 1; if ($nex_mon > 11) { $nex_mon = 0; $nex_year++; } } else { $nex_year++; } $count++; } while ($count < SECONDS_1DAY); // Something went wrong, default to 5 minutes return $cur_time + SECONDS_5MINUTES; } // Check if cron is properly constructed function cron_check_syntax($cron) { return preg_match("/^[\d|\*].* .*[\d|\*].* .*[\d|\*].* .*[\d|\*].* .*[\d|\*]$/", $cron); } ?>