set php code to be run in the future

Sometimes you may need a code which should be run in certain date interval. No, i don’t mean whole php file, for that there is a technology called “Cron Jobs”. I mean code fragment in your existing PHP project. For example you want you background to be red after 23:59. Or at 31st decebmer night you want some “happy new year” banner to be appear for 1-2 hours. Or you just creating some scheduled event module and this logic can help you build it. Let’s write this simple trick. Continue reading →