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
How to add comments in php?
What are the benefits of composer?
Tell me is it possible to submit a form with a dedicated button?
What is the main difference between require() and require_once()?
How is the comparison of objects done in php?
Explain setcookie() function in php?
How do I install php and apache on windows 10?
What is the content of /etc directory?
What is apache and php?
Does php has a future?
Which operator is used to combine string values in php?
Can I include php in javascript?
Is empty java?
Tell me what is the meaning of a final class and a final method?
What is the use of curl()?