note 27451 deleted from function.date by victor

From: Date: Sun, 08 Dec 2002 20:07:25 +0000
Subject: note 27451 deleted from function.date by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40542@lists.php.net to get a copy of this message
Me an my Cronjob no longer forgett birthdays. returns 0, if you don't have to matter, 2, two days before the birthday (for me it sends mail) and 1 on birthday (for me it sends mail to whoever has) feed it with "06.12" or "24.01" .... small modifications in ereg() and your parameter may look as you like it... function datecalc($input) { if (ereg("([0-9]{1,2}).([0-9]{1,2})", $input, $abc)) { $ak_d = date("d");$ak_m = date("m"); if($abc[2] == $ak_m){ if($abc[1] == $ak_d) return 1; elseif(($abc[1]-$ak_d)==2) return 2; } elseif ($ak_m == $abc[2]-1) { if($abc[1]==2) { if(date("t") == $ak_d) return 2; }elseif($abc[1]==1){ if((date("t")-1) == $ak_d) return 2; } } return 0; } else { return 0; } } // function ciao !

« previous php.notes (#40542) next »