vicodin Posted November 29, 2008 Share Posted November 29, 2008 Hello all i am trying to compare dates and find out if the person signed up this month or before this month. So i came up with this and it works but was wondering if there was a better way to do it. $signup = "2008-10-09";//<-- What ever date is pulled from DB $date = date("Y/m"); $date.= "/01"; $date = strtotime($date); $signup = strtotime($signup); if ($signup > $date){ echo 'Signed Up This Month'; } else { echo ' Signed Up Before'; } Link to comment https://forums.phpfreaks.com/topic/134707-working-with-dates/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.