Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 repository in php?

1021


What is xss and csrf?

939


How can I embed a java program in php file and what changes have to be done in php.ini file?

966


When a conditional statement is ended with an endif?

943


how to track no of users logged in?

1028


What is the use of namespace in php?

984


Can we extend multiple classes in php?

1043


What is a model in php?

1063


Can I use node js with php?

1044


What is reference variable php?

1032


What is a PHP Filter?

1081


What do you mean by core php?

956


How many types of array supported in php?

983


How to get length of an array in PHP?

1028


What is difference between php and html?

1054