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 is the difference between nowdoc and heredoc?
What are the functions of string?
Can you extend a final defined class?
Tell me how can we check the value of a given variable is alphanumeric?
What is the difference between fopen() and fclose()?
What is a query in a database?
Write a select query that will be displayed the duplicated site name and how many times it is duplicated?
Tell me is it possible to submit a form with a dedicated button?
What is include in php?
What is difference between base_url and site_url?
What is print_r?
What is crypt () in php?
What’s the difference between htmlentities() and htmlspecialchars()?
/temp is a type of filesystem directory. State Whether True or False?
What is the purpose of break and continue statement?