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 / ash

$date1 = date('Y-m-d');
$date2 = "2007-07-05";
$days = (strtotime($date1) - strtotime($date2)) / (60 * 60
* 24);
echo " No of $days difference";

Is This Answer Correct ?    25 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What backslash character will match whitespace?

1077


What would occur if a fatal error was thrown in your php program?

1071


Tell me how comparison of objects is done in php5?

940


How do I find out the number of parameters passed into function9?

991


How can you retrieve a cookie value?

1086


What is php ci?

1006


What does it mean when it says the csrf token is invalid?

920


What is session in PHP. How to remove data from a session?

993


Why php is used with mysql?

1037


What is final in php?

1103


What is final keyword in php?

1055


How does php work?

981


What is difference between post and put in rest?

1033


Explain what are the two main string operators?

965


Tell me what is the difference between the functions strstr() and stristr()?

1069