- time: documentation ( source)
- floor: documentation ( source)
- strtotime: documentation ( source)
<?php
function get_age($birth_date){
return floor((time() - strtotime($birth_date))/31556926);
}
echo " I am ".get_age("1978-12-30") ." years old";