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
Explain the visibility of the property or method?
How to list all values of submitted fields?
What are the benefits of using queries?
What does a dependant variable mean?
How to execute a function in php?
How do you pass a variable by value?
What is difference between web service and api?
What is faster in php?
What is zend studio for?
What is restful api?
which will print out the php call stack?
What is mean by an associative array?
Can I learn php without knowing c?
What is move_uploaded_file in php?
Explain the importance of the function htmlentities.