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 use of htmlspecialchars in php?
What is the difference between pop3 IMAP and MAPI?
What does $_server means?
What is the use of hooks?
What the use of var_dump()?
Explain how can php and javascript interact?
What is meant by MIME?
What is difference between isset and empty in php?
Explain some of the php array functions?
> symbol is used to redirect the output of a command. State Whether True or False?
How come the code works, but does not for two-dimensional array of mine?
What is the mysql injection?
What is a null coalescing operator in php7?
What is meant by pear in php? What is the purpose of it?
What the difference between the 'bitwise and' operator and the 'logical and' operator?