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
Where are cookies stored php?
What is the use of session and cookies in php?
Is not null in php?
What is the difference between htmlentities() and htmlspecialchars()?
What is csrf cookie?
When to use self over $this?
How does html form submit work?
What will the ?getdate() function returns in PHP?
What is session in PHP. How to remove data from a session?
What is cookie?
When should you use a stored procedure?
How to update memcached when you make changes to php?
What is the functionality of the functions strstr() and stristr()?
What is the current stable version of php?
Should I use mysqli or pdo?