Johnson Johnson - 1 year ago 111
PHP Question

PHP: Birthday check today´s date

I have userĀ“s birthday stored in

as 1999-02-26.

How can I check if the birthday is today?

if(date('m-d') == ..?

Answer Source
if(date('m-d') == substr($birthday,5,5))

To add what Tim said:

if(date('m-d') == substr($birthday,5,5) or (date('y')%4 <> 0 and substr($birthday,5,5)=='02-29' and date('m-d')=='02-28'))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download