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 what is the main difference between require() and require_once()?
How error handling is being handled by php?
How many functions are there in php?
How variables are passed through arguments?
What are the different data types in javascript?
How a variable is declared in php?
Does php have future?
Which is used to maintain the value of a variable over different pages?
what is the current salary package in India for a PHP programmer who has 1.5 years experience
Tell me whether it is possible to share a single instance of a memcache between multiple php projects?
What is boolean in php?
What is difference between include,require,include_once and require_once()?
What is var_dump?
What happens when submit button is clicked?
Write a php script to get the largest key in an array?