Well, ok, so I understand the problem correctly, you want to take a date, say 2000-02-04 and figure out what week of that year that date fell under? Lets go through what we'd have to do:
first, make a function:
function weekofyear($month, $day, $year) {
Ok, now, we need to figure out what day of the year this was.
$day_of_year = date("z", mktime(0,0,0,$month,$day,$year)) + 1; // Actually gives us the day starting at 0, add 1
Get the day of the week this year starts on (assuming that the first partial week in week 1)
$start_of_year = date("w", mktime(0,0,0,1,1,$year));
Now, we need the difference in days between our days ($day_of_year) and the begining of the second week
$diff_days = day_of_year - (8 - $start_of_year);
return floor($diff_days / 7) + 2;
Add two to compensate for the first week being partial and the floor().
}
Hope that helps!
Chris King