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

Which escape sequences can be used in single quoted strings in php?

944


Explain what does the expression exception::__tostring means?

873


Which is the correct way to check if a session has already been started ?

988


What is the delimiter default in PHP?

1081


Tell me how can we automatically escape incoming data?

926


What is php glob?

1003


What is a composer in PHP?

955


What is a string in php?

977


What does csrf token mean?

934


How to get the directory name out of a file path name?

955


Why use php artisan serve?

963


Why echo is faster than print in php?

982


What is urlencode and urldecode in php?

1129


Can a super () and this () keywords be in same constructor?

908


How do you parse and process html/xml in php?

1024