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 are psrs? Choose 1 and briefly describe it?
Which function is used in php to check the data type of any variable?
How can we encrypt the password using php?
How to close a session properly?
What is php call function?
What is ci framework in php?
How many ways to include array elements in double-quoted strings using php?
What is difference between include and include_once in php?
Is set in php?
How to remove all duplicate values in array in php?
Explain the visibility of the property or method?
Is php class name case sensitive?
Write a program in php to print a table of a number?
What is the difference between php and cakephp?
What is putenv?