How can we know the number of days between two given dates
using PHP?
Answer Posted / ash
$date1 = date('Y-m-d');
$date2 = "2007-07-05";
$days = (strtotime($date1) - strtotime($date2)) / (60 * 60
* 24);
echo " No of $days difference";
| Is This Answer Correct ? | 25 Yes | 4 No |
Post New Answer View All Answers
Which escape sequences can be used in single quoted strings in php?
Explain what does the expression exception::__tostring means?
Which is the correct way to check if a session has already been started ?
What is the delimiter default in PHP?
Tell me how can we automatically escape incoming data?
What is php glob?
What is a composer in PHP?
What is a string in php?
What does csrf token mean?
How to get the directory name out of a file path name?
Why use php artisan serve?
Why echo is faster than print in php?
What is urlencode and urldecode in php?
Can a super () and this () keywords be in same constructor?
How do you parse and process html/xml in php?