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
How to return a value back to the function caller?
How to reset/destroy a cookie in php?
Which is a perfect example of runtime polymorphism?
What is $_ get?
How can you increase the maximum execution time of a script in php?
What are the ways to include file in php?
Tell me how to create a session? How to set a value in session? How to remove data from a session?
Difference between $message vs. $$Message in php.
Is PHP runs on different platforms (Windows, Linux, Unix, etc.)?
What are the array functions in php?
What are the functions for imap?
Why php is better?
How to send email using php script?
What language is similar to php?
Which will check if a function exists?