21
Apr/09
2

A nice little touch…

I just redesigned my home page, and wanted to mention this nice little touch I included.

Rather than update my age in the about section every time I have a birthday, I decided to do this instead:

<?php
function birthday ($birthday){
list($year,$month,$day) = explode(”-”,$birthday);
$year_diff  = date(”Y”) – $year;
$month_diff = date(”m”) – $month;
$day_diff   = date(”d”) – $day;
if ($day_diff < 0 || $month_diff < 0)
$year_diff–;
return $year_diff;
}
?>

<p>I am a <?php echo birthday(”1987-03-06″); ?> year old web developer, based on the Sunshine Coast, Queensland.</p>

Tricky… :D You like?

Filed under: Tech
Comments (2) Trackbacks (0)
  1. He he… That’s heaps cool…. Now u will never have 2 ask ur self how old u r…

  2. A “me” platform with open API would be great, give me a week and I’ll send you a demo link. I think you’ll like it. :)

Leave a comment


No trackbacks yet.