Solved like this,
is this a good code?
Code:
// This month
$string = 'thismonth';
$thisMonth = new thanks($start_epoch,$end_epoch);
$thisMonth->grab_n_sort($string,$vbseo_url,$cached_technique);
$thisMonth->print_chart(10,$table_summary);
// 1 month ago
$start_epoch = mktime(0, 0, 0, (date(m)-1), 1, date(Y)); // epoch for beginning of month
$end_epoch = mktime(23, 59, 0, (date(m)), 0, date(Y)); // epoch for end of month
$string = 'oneMonthsAgo';
$twoMonthsAgo = new thanks($start_epoch,$end_epoch);
$twoMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$twoMonthsAgo ->print_chart(10,$table_summary);
// 2 months ago
$start_epoch = mktime(0, 0, 0, (date(m)-2), 1, date(Y)); // epoch for beginning of month
$end_epoch = mktime(23, 59, 0, (date(m)-1), 0, date(Y)); // epoch for end of month
$string = 'twoMonthsAgo';
$oneMonthsAgo = new thanks($start_epoch,$end_epoch);
$oneMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$oneMonthsAgo ->print_chart(10,$table_summary);