2009 has 53 weeks
For an application I had to write a small tool that will write weeks into a database, as they get referenced all over the place inside the application. They were not real weeks, but had the same length, so using Calenderweeks was the easiest to do there. To make sure there would never be a shortage on weeks in advance, as the application was used for planing future actions, the tool was to run as a cronjob once a month and make sure there are at least 150 weeks into the future ready to be used.
After a couple months of use, there came a small problem. The application would import data from another system and suddenly that import had a week 53 in it. But a year has only 52 weeks, I exclaimed and there I was so wrong. 2009 has actually 53 calendar weeks. So to make it future proof for when such a thing might happen again, here my little code that determines the number of possible weeks in the current year. You need nothing else than the date function to make it work.
$weeksInYear = date('W',mktime(23,59,59,12,31, date('Y')));