How can we know the number of days between two given dates
using PHP?
Answer Posted / dheeraj
<?php
$date1=date('Y-m-d');
$date2="2007-09-15";
echo (round($diff=strtotime($date1)-strtotime($date2)))/86400;
?>
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
How does php session work?
How to create an array of a group of items inside an html form?
Explain Type hinting in PHP?
Where are the persistent cookies stored on your computer?
When is a conditional statement ended with an endif?
What are php variables?
What are the features of php?
What does == mean in php?
Which is variable cost?
What is a session in php?
How can I prevent sql-injection in php?
When do sessions end?
What PHP stands for?
What are php data types?
What are the rules for naming a php variable?