public static function compare($date1, $date2, $type = 'date') {
		if ($type == 'date') {
			return date('Y-m-d', strtotime($date1)) === date('Y-m-d', strtotime($date2));
		} else if ($type == 'datetime' || $type == 'time') {
			return date('Y-m-d H:i:s', strtotime($date1)) === date('Y-m-d H:i:s', strtotime($date2));
		} else {
			return strtotime($date1) == strtotime($date2);
		}
	}
public static function compare($date1, $date2, $type = 'date') {
		if ($type == 'date') {
			return date('Y-m-d', strtotime($date1)) === date('Y-m-d', strtotime($date2));
		} else if ($type == 'datetime' || $type == 'time') {
			return date('Y-m-d H:i:s', strtotime($date1)) === date('Y-m-d H:i:s', strtotime($date2));
		} else {
			return strtotime($date1) == strtotime($date2);
		}
	}
public static function compare ( $ date1 , $ date2 , $ type = 'date' ) { if ( $ type == 'date' ) { return date ( 'Y-m-d' , strtotime ( $ date1 ) ) === date ( 'Y-m-d' , strtotime ( $ date2 ) ) ; } else if ( $ type == 'datetime' || $ type == 'time' ) { return date ( 'Y-m-d H:i:s' , strtotime ( $ date1 ) ) === date ( 'Y-m-d H:i:s' , strtotime ( $ date2 ) ) ; } else { return strtotime ( $ date1 ) == strtotime ( $ date2 ) ; } }
Compare two dates

@param string $date1
@param string $date2
@param string $type
@return boolean
Compare two dates