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 is needed to be able to use image function?

1088


How long is a php session valid?

1061


What is the latest version of php?

1094


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

1093


How can I learn php fast?

1125


What is the correct php command to use to catch any error messages within the code?

1119


What is the php function that removes the last element of the array and returns it?

1010


What is csrf verification?

1116


How can we change the maximum size of the files to be uploaded?

1087


Why should I learn php?

1125


What is new static in php?

1055


what is benefit of magento?

2584


Why json is used in php?

1048


Why would we use === instead of ==?

8909


What is super keyword in php?

1153