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

"The function expects to be given a string containing a US
English date format and will try to parse that format into a
Unix timestamp (the number of seconds since January 1 1970
00:00:00 GMT), relative to the timestamp given in now, or
the current time if none is supplied." --- in php.net So Be
careful when calculating with strtotime(). Therefore in the
above ans it might be like this way
$date1 = date('M-d-Y');
$date2 = "August-07-2007";

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are php libraries?

934


What is isset in php form?

1019


How many columns can be added in a table in mysql?

997


What does a delimiter do in mysql?

1062


How to insert an new array element in array?

1042


What is difference Between PHP 5 and 7?

1121


Is php an oop?

979


How can you get the size of an image in PHP?

999


How to call a php function from html button?

1085


What is the special meaning of __sleep and __wakeup?

1006


Why do we use interface in php?

973


Explain different sorting function in php?

1071


Tell me what sized websites have you worked on in the past?

900


What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?

961


What is $$ in php?

970