How to make Simple Age Calculator Using PHP

Problem:- How to make Simple Age Calculator Using PHP?

Solution – Simple Age Calculator Using PHP

<?php
$first = new DateTime("1992-01-01");
$second = new DateTime("2001-01-01");
$diff = $second->diff($first);
printf("Your age is %d Year", $diff->format('%a')/365);
?>

Be the first to comment

Leave a Reply

Your email address will not be published.


*