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 / dheeraj

<?php
$date1=date('Y-m-d');
$date2="2007-09-15";
echo (round($diff=strtotime($date1)-strtotime($date2)))/86400;
?>

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I run a php file?

954


How to access a global variable inside a function?

1001


What is different types of visibility?

918


What u mean by query?

1026


When do you use define() and when do you use const. What are the main differences between those two?

1050


What is the difference between session_unregister() and session_unset()?

1110


Explain briefly about a search-friendly site looks like?

893


Can we extend final class in php?

1034


What is a stored procedure in mysql?

1083


Which programming language does php resemble?

942


How to execute a php script from the command line?

1079


What is inheritance in php with example?

1005


What are the different types of statements that are present in php?

996


For image work which library is used in php?

980


What is the purpose of the php empty function?

951