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?
How can we know the number of days between two given dates
using MySQL?

Answer Posted / indira majumder

<?php
$date1 = date('y-m-d');
$date2 = '2007-12-7';
$days = (strtotime($date2)-strtotime($date1))/(60*60*24);
echo "Number of Days since '2007-12-7': $days";

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of htmlspecialchars in php?

952


What is the difference between pop3 IMAP and MAPI?

1015


What does $_server means?

931


What is the use of hooks?

917


What the use of var_dump()?

1002


Explain how can php and javascript interact?

991


What is meant by MIME?

1004


What is difference between isset and empty in php?

968


Explain some of the php array functions?

1038


> symbol is used to redirect the output of a command. State Whether True or False?

1121


How come the code works, but does not for two-dimensional array of mine?

938


What is the mysql injection?

951


What is a null coalescing operator in php7?

1110


What is meant by pear in php? What is the purpose of it?

929


What the difference between the 'bitwise and' operator and the 'logical and' operator?

923