I want to update the div in html to show different content every week only with php and without cron. How will this be possible to achieve? The following code is designed to activate the code every 2 months on the 10th day, but I think the logic will be different. If possible, some hint or example would be great! I will be happy to hear from you!
if (date('d')==10 && date('m') % 2 == 0) {
$today = date('Ymd');
$last_run = variable_get('my_last_run', 0);
if ($last_run!=$today) {
variable_set('my_last_run', $today);
}
}
source
share