PHP Date Question

I am trying to write a news managment system in PHP and had a couple questions.

For each news article I want to store the date it was submitted. I then want to only display items that are newer than 30 days on the main news page. Is there a way I can get a date in php so that i can just subtract 30 from it and use that in an if statement?


$d = date("d");
$m = date("m");
$y = date("y");

that gives you the day the month and the year as seperate variables so it is easier for you to mess around with… you should be able to subtract easily from one number instead of a string…

If I use those I have to account for how many days are in each month to figure out if something is 30 days old. What I was looking for was possibly something with the year and then the number of days from the beginning of the year. I have seen formats like this before (can’t remember what this date format is called) and was wondering if PHP had anything like this.

$day = date(“z”);

http://us3.php.net/manual/en/function.date.php

Ok, now I feel dumb, I looked through that table before asking but must have just not seen it.

Thanks for the help.