0 like 0 dislike
62 views
in Education & Reference by (180 points) | 62 views

1 Answer

0 like 0 dislike
<?php
$firstdate               = "2019-06-01";
$seconddate        = "2014-06-22";
 
$differnce              = abs(strtotime($seconddate) - strtotime($firstdate));
 
$years                   =   floor($differnce / (365*60*60*24));
$months               =   floor(($differnce - $years * 365*60*60*24) / (30*60*60*24));
$days                    =   floor(($differnce- $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
 
printf("%d years, %d months, %d days", $years, $months, $days);
?>
by (1.4k points)

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jan 4, 2018 in Education & Reference by Sam (1.4k points) | 334 views
0 like 0 dislike
1 answer
asked Aug 1, 2017 in Education & Reference by Krish (800 points) | 143 views
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked Jul 7, 2014 in Education & Reference by Bhoomika (50 points) | 10.9k views
1 like 0 dislike
1 answer
asked Apr 15, 2014 in Education & Reference by Yogi (180 points) | 91 views
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
2 answers

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,210 questions
1,356 answers
554 comments
2,099 users