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
What is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?
How to create an array of a group of items inside an html form?
How to join multiple strings stored in an array into a single string?
What is a trait in php?
Is empty java?
Does csrf token change?
What is the use of curl()?
What is use of isset function in php?
What are the correct and the most two common way to start and finish a PHP block of code?
Tell me how do I escape data before storing it into the database?
Give the case where we can use get and we can use post methods?
How can we automatically escape incoming data?
How to strip whitespace (or other characters) from the beginning and end of a string?
What is difference between post and put in rest?
How do I get csrf token?