Well, I definitely recommend the cron job for the purpose. But theoretically, you could have a PHP script run itstime()
, sleep for an hour, and loop. This is pretty crazy, though.
The script would look like:
<?php
include('whatever.php');
while(true) {
itstime();
sleep(3600);
}
?>
One would probably run it with nohup php mycrazyscript.php &
to detach it from your terminal and make it keep running, and using pkill -f mycrazyscript
to terminate it.
The reason this is crazy is that now you've got a sleeping PHP process hanging around doing nothing for 59 minutes out of every hour, and you have to make sure it's both running and running at the right time, both of which cron would take care of for you.