How can we know the number of days between two given dates
using PHP?
How can we know the number of days between two given dates
using MySQL?
Answer Posted / indira majumder
<?php
$date1 = date('y-m-d');
$date2 = '2007-12-7';
$days = (strtotime($date2)-strtotime($date1))/(60*60*24);
echo "Number of Days since '2007-12-7': $days";
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is the difference between the functions strstr() and stristr()?
Differences between get and post methods?
What is the use of print_r function in php?
What function do we use to find length of string, and length of array?
What is repository in php?
What is the difference between runtime exception and compile time exception?
What is the current php version?
how to use http headers inside php? Write the statement through which it can be added?
Can you define an array argument as a reference type?
Is python similar to php?
How do I make a reset button in html?
Why overriding is called runtime polymorphism?
What is inheritance in php? How many types of inheritance supports php?
Explain the difference between array_merge() and array_combine()?
How to take a substring from a given string?