Skip to content

Instantly share code, notes, and snippets.

@iammerrick
Created June 24, 2010 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iammerrick/450807 to your computer and use it in GitHub Desktop.
Save iammerrick/450807 to your computer and use it in GitHub Desktop.
public static function get_relative_month()
{
$count = 31; // Generally 31 days in a month.
$month = array();
for ($i = 0; $i < $count; $i++)
{
if(($i % $count) < ($count / 2))
{
$month[self::subtract_day($i)] = date('j', self::subtract_day($i));
}
else
{
$month[self::add_day($i)] = date('j', self::add_day($i));
}
}
return $month;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment