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 array and function?

1058


What is the difference between die () and exit () in php?

988


How do you compare strings in java?

928


What is php regular expression?

1013


What is the method to register a variable into a session?

852


Explain which cryptographic extension provide generation and verification of digital signatures?

1012


What is a PHP Filter?

1077


What is user defined function in php?

974


How to count a number of words in a string in php?

967


What beforeFilter() is used?

1114


Explain include(), include_once, require() and require_once?

1024


What is htaccess? Why do we use this and where?

989


What is php dependency injection?

932


What is difference between rest api and restful api?

985


What type of language is php?

997