Srahul07's solution works perfectly... If you abide by the Monday-Sunday week system! Here in 'murica, non-business folk tend to go by Sunday-Saturday being a week, so May 1, 2011 is week 1 and May 2, 2011 is still week 1.
Adding the following logic to the bottom of his function, right before it returns $week will convert this to a Sunday -> Monday system:
if (!date('w',strtotime("$year-$month-01")) && date('w',$timestamp))
elseif (date('w',strtotime("$year-$month-01")) && !date('w',$timestamp))
That seems to work for all cases, months starting with Sundays, January of 2011, 2012, and 2013, and all sorts of other random dates I plugged in. Thanks for that function, S. Rahul.
Sadly, after all my work to get that function up and running, I learn that my users use a more ridiculous system wherein the concept of "weeks" is too complicated, so they simply number the occurrences of a day in the month and ignore whatever "week" we're in. A brute-force system of counting how many Fridays, etc. have already occurred in the month is the only solution I could come up with, because that's all their logic is. T_T