How can we know the number of days between two given dates
using PHP?
Answer Posted / savvy
"The function expects to be given a string containing a US
English date format and will try to parse that format into a
Unix timestamp (the number of seconds since January 1 1970
00:00:00 GMT), relative to the timestamp given in now, or
the current time if none is supplied." --- in php.net So Be
careful when calculating with strtotime(). Therefore in the
above ans it might be like this way
$date1 = date('M-d-Y');
$date2 = "August-07-2007";
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What are php libraries?
What is isset in php form?
How many columns can be added in a table in mysql?
What does a delimiter do in mysql?
How to insert an new array element in array?
What is difference Between PHP 5 and 7?
Is php an oop?
How can you get the size of an image in PHP?
How to call a php function from html button?
What is the special meaning of __sleep and __wakeup?
Why do we use interface in php?
Explain different sorting function in php?
Tell me what sized websites have you worked on in the past?
What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?
What is $$ in php?