* A small script to calculate my age, instead of updating a webpage once a year. */ // Edit the numbers below to match your birthdate. $birthyear=1982; $birthmonth=4; $birthday=23; $nowyear=date("Y"); $nowmonth=date("m"); $nowday=date("d"); if($nowmonth > $birthmonth) { //Age is simply the difference in years. print $nowyear - $birthyear; return; } else if($nowmonth == $birthmonth) { if($nowday < $birthday) { print $nowyear - $birthyear - 1; return; } else { print $nowyear - $birthyear; return; } } else { print $nowyear - $birthyear - 1; return; } ?>