How to create the PHP Script to Calculate the Age Using the
Inputs Of our Birth date and the Current date?
Answer Posted / prakash.matte
<?php
$dob = '29-05-1986';
$age = date('Y') - date('Y', strtotime($dob));
if (date('md') < date('md', strtotime($dob))) {
$age--;
}
echo $age;
?>
Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What are the method available in form submitting?
Define soundex()?
Is it easy to learn php?
What is the tags in PHP is not a valid way to begin and end a PHP code block?
What is singleton pattern in php?
What is the difference between $var and $$var?
Where are cookies stored php?
How escape single quotes php?
What is htmlentities function in php?
What is the functionality of the functions strstr() and stristr()?
Which is the best php framework for a beginner?
What is the difference between explode() and split() functions?
What is an object in php?
What was the old name of php?
Why sessions are used in php?