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 difference between the functions strstr() and stristr()?

984


Differences between get and post methods?

1038


What is the use of print_r function in php?

940


What function do we use to find length of string, and length of array?

957


What is repository in php?

1017


What is the difference between runtime exception and compile time exception?

1104


What is the current php version?

1085


how to use http headers inside php? Write the statement through which it can be added?

1023


Can you define an array argument as a reference type?

920


Is python similar to php?

1025


How do I make a reset button in html?

995


Why overriding is called runtime polymorphism?

975


What is inheritance in php? How many types of inheritance supports php?

998


Explain the difference between array_merge() and array_combine()?

989


How to take a substring from a given string?

1009