How can we know the number of days between two given dates
using PHP?
Answer Posted / dheeraj
<?php
$date1=date('Y-m-d');
$date2="2007-09-15";
echo (round($diff=strtotime($date1)-strtotime($date2)))/86400;
?>
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is design pattern? Explain all including singleton pattern?
What are the advantages of stored procedures in php?
How we load all classes that placed in different directory in one php file , means how to do auto load classes.
What are the benefits of using queries?
Which is not a php magic constant?
How to pass an argument to a function?
What is the difference between fopen() and fclose()?
What is self in php?
How to check curl is enabled or not in PHP
How to insert an new array element in array?
What is PHP? Who is the father or inventor of PHP?
What is mysql_real_escape_string used for?
What are the common uses of php?
Which is better mysql or sql?
What is the meaning of a persistent cookie?