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 is needed to be able to use image function?
How long is a php session valid?
What is the latest version of php?
How to join multiple strings stored in an array into a single string?
How can I learn php fast?
What is the correct php command to use to catch any error messages within the code?
What is the php function that removes the last element of the array and returns it?
What is csrf verification?
How can we change the maximum size of the files to be uploaded?
Why should I learn php?
What is new static in php?
what is benefit of magento?
Why json is used in php?
Why would we use === instead of ==?
What is super keyword in php?