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 array and function?
What is the difference between die () and exit () in php?
How do you compare strings in java?
What is php regular expression?
What is the method to register a variable into a session?
Explain which cryptographic extension provide generation and verification of digital signatures?
What is a PHP Filter?
What is user defined function in php?
How to count a number of words in a string in php?
What beforeFilter() is used?
Explain include(), include_once, require() and require_once?
What is htaccess? Why do we use this and where?
What is php dependency injection?
What is difference between rest api and restful api?
What type of language is php?