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


Please Help Members By Posting Answers For Below Questions

What are the data types in php?

553


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1281


What changes I have to do in php.ini file for file uploading?

573


List types of array are available in php?

557


What are the main error types in php?

527






What is serialization in php?

471


How to send a cookie to the browser?

554


Is server side a session?

500


What is session and Cokkies . How it works . tell some thing about Session_id()

1547


How to assigning a new character in a string using php?

546


What does the initials of php stand for?

539


What does explode do in php?

562


How to access a Static Member of a Class in PHP?

520


What is difference between static and constant in php?

518


Which cryptographic extension provide generation and verification of digital signatures?

533