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 do I run a php file?
How to access a global variable inside a function?
What is different types of visibility?
What u mean by query?
When do you use define() and when do you use const. What are the main differences between those two?
What is the difference between session_unregister() and session_unset()?
Explain briefly about a search-friendly site looks like?
Can we extend final class in php?
What is a stored procedure in mysql?
Which programming language does php resemble?
How to execute a php script from the command line?
What is inheritance in php with example?
What are the different types of statements that are present in php?
For image work which library is used in php?
What is the purpose of the php empty function?