The "old" way to compare two or more dates is to convert then to an unix timestamp (seconds in float) using strtotime() function. For example:
if((strtotime('2011-05-10') - strtotime('2011-05-01')) > 604800)
{
echo('A week has passed');
}
if((strtotime('2011-06-10') - strtotime('2011-05-01')) > 2629743)
{
echo('A month has passed');
}
Or the "new" way is to use the DateTime class bundled with PHP 5.2 or newer. Have a look at http://php.net/manual/en/book.datetime.php.