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

How does php session work?

907


How to create an array of a group of items inside an html form?

934


Explain Type hinting in PHP?

977


Where are the persistent cookies stored on your computer?

940


When is a conditional statement ended with an endif?

884


What are php variables?

928


What are the features of php?

982


What does == mean in php?

920


Which is variable cost?

897


What is a session in php?

945


How can I prevent sql-injection in php?

971


When do sessions end?

900


What PHP stands for?

982


What are php data types?

929


What are the rules for naming a php variable?

990