How to create the PHP Script to Calculate the Age Using the
Inputs Of our Birth date and the Current date?

Answer Posted / sandhya

<?php
$date1 = time();
$date2 = mktime(0,0,0,02,01,1979);
$ddif = $date1 - $date2;
$age = floor(($ddif/(60*60*24))/365);
echo $age;
?>

Is This Answer Correct ?    0 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is php artisan serve?

517


What are the 3 scope levels available in php and how would you define them?

503


What are the different loops in php?

534


Name some of the popular frameworks in php.

549


What is putenv?

563






What are the two types of variables?

526


How can you send http header to the client in php?

498


Why php 7 is faster?

507


Is php used anymore?

523


What are examples of independent and dependent variables?

490


Applications written to provide a GUI shell for Unix and Linux are called

571


How is php different from other languages?

477


Which cryptographic functions in php returns the longest hash value?

572


What is fetch array in php?

573


What is the difference between substr() and strstr()?

780