PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Sat May 28, 2005 9:09 am
Code: Select all
$year = "2005"; //Year
$month = "06"; //Month
$day = "29"; //Day
now what i want is just to comapre the above given date with todays date and get the difference in days?
any help plz.
ropson
Forum Newbie
Posts: 2 Joined: Fri May 27, 2005 9:36 am
Post
by ropson » Sat May 28, 2005 9:22 am
Code: Select all
$year = "2005"; //Year
$month = "06"; //Month
$day = "29"; //Day
$yourDate=$year.'-'.$month.'-'.$day;
$today=date('Y-m-d');
$days=(strtotime($yourDate)-strtotime($today))/86400;
echo $days;