Benson
04-08-2002, 01:19 PM
I found this little bit of PHP code that will display a person's age in a web page. How can I change it so that the result will be "12" instead of "12.02345"?
<?php
$dofb = strtotime ("2 November 1980"); // date to calculate from
$age = strtotime ("now")-$dofb;
$age_in_years = $age/31557600; // 31557600 seconds in a year
echo "$age_in_years";
?>
<?php
$dofb = strtotime ("2 November 1980"); // date to calculate from
$age = strtotime ("now")-$dofb;
$age_in_years = $age/31557600; // 31557600 seconds in a year
echo "$age_in_years";
?>