How can we know the number of days between two given dates
using PHP?
Answer Posted / ash
$date1 = date('Y-m-d');
$date2 = "2007-07-05";
$days = (strtotime($date1) - strtotime($date2)) / (60 * 60
* 24);
echo " No of $days difference";
| Is This Answer Correct ? | 25 Yes | 4 No |
Post New Answer View All Answers
What backslash character will match whitespace?
What would occur if a fatal error was thrown in your php program?
Tell me how comparison of objects is done in php5?
How do I find out the number of parameters passed into function9?
How can you retrieve a cookie value?
What is php ci?
What does it mean when it says the csrf token is invalid?
What is session in PHP. How to remove data from a session?
Why php is used with mysql?
What is final in php?
What is final keyword in php?
How does php work?
What is difference between post and put in rest?
Explain what are the two main string operators?
Tell me what is the difference between the functions strstr() and stristr()?