On the code above im able to have an interval until 60 Hours if the script is loaded every minute. In other words, the script above will be loaded by a cronjob every minute.
Since the users that will use this may use hosting that do not have rights to set Cronjobs, I need to make this script only with PHP.
How can I do it to make it for longer, for exemple for once a month (672 hours)?
/** suppose we have 1 hour and 1 minute inteval 01:01 */ $interval_source = "01:01"; $time_now = strtotime( "now" ) / 60; $interval = substr($interval_source,0,2) * 60 + substr($interval_source,3,2); if( $time_now % $interval == 0){ /** Run things after interval */ }