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 the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?

986


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

1044


How to join multiple strings stored in an array into a single string?

1095


What is a trait in php?

1071


Is empty java?

1088


Does csrf token change?

968


What is the use of curl()?

1115


What is use of isset function in php?

1105


What are the correct and the most two common way to start and finish a PHP block of code?

1112


Tell me how do I escape data before storing it into the database?

1133


Give the case where we can use get and we can use post methods?

1094


How can we automatically escape incoming data?

1041


How to strip whitespace (or other characters) from the beginning and end of a string?

943


What is difference between post and put in rest?

1068


How do I get csrf token?

1021