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

Where are cookies stored php?

910


What is the use of session and cookies in php?

988


Is not null in php?

942


What is the difference between htmlentities() and htmlspecialchars()?

993


What is csrf cookie?

912


When to use self over $this?

987


How does html form submit work?

912


What will the ?getdate() function returns in PHP?

1083


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

974


What is cookie?

1001


When should you use a stored procedure?

962


How to update memcached when you make changes to php?

964


What is the functionality of the functions strstr() and stristr()?

959


What is the current stable version of php?

1033


Should I use mysqli or pdo?

945