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 is the difference between php 5 and php 7?
Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?
Do you have to initialize variables in php?
Where is my php ini file?
How to get the total number of values in an array?
Explain what are the three classes of errors that can occur in php?
What are the php functions?
What is framework? How it works? What is advantage?
What is magic quotes?
CWD is a type of shell variable. State Whether True or False?
How do I escape data before storing it into the database?
can you give me an example code of calling java script function in php variable using AJAX.or with out ajax??????
Explain the different types of errors in php.
Which is a perfect example of runtime polymorphism?
What are majic methords in php?