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 arrays are used in php?
What is full form of PHP?
What is use of echo in php?
What is csrf token and why it is required?
How is it possible to know the number of rows returned in result set?
how to use http headers inside php? Write the statement through which it can be added?
The left association operator % is used in PHP for?
What is the use of trim function in php?
How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain
What is the correct and the most two common way to start and finish a php block of code?
What is var_dump function in php?
Is null in php?
How can you tell if a number is even or odd without using any condition or loop?
What are psrs? Choose 1 and briefly describe it?
What are access specifiers?