How to make Simple Age Calculator Using PHP

How to Expose and Route to a Resource?
How to Expose and Route to a Resource?

आज इस आर्टिकल में हम आपको 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);
?>

Read this – Simple Form Validation With Error Message

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *