adspace


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 is trait in php?

1065


What is difference between static and final in php?

1108


How to create a web form?

1109


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

1988


What does $_files means?

1162


Tell me what kind of things have you done on the social side?

1064


sort term descripttion form, report and uery

2254


What is the difference between htmlentities() and htmlspecialchars()?

1090


How to calculate the difference between two dates using php?

1143


What sized websites have you worked on in the past?

1085


Write a program using while loop?

1116


Name and explain five of the PHP error constants?

1033


What is the current stable version of php? What advance thing in php7?

1094


Which variable declarations within a class is invalid in php?

1047


how to detect a mobile device using php

1173