一年一个月的一周?

Cob*_*ast 2 php math datetime calendar

我试图通过一年中的一周和一年中获得一年中的月份数.所以例如第1周是在1月,并且返回1,第6周是在2月,所以我想要2.

我试着去date_parse_from_format('W/Y')但却没有成功(它给了我错误).

有什么方法可以使用date_parse_from_format()或有其他方式吗?

ADW*_*ADW 6

print date("m",strtotime("2011-W6-1"));
Run Code Online (Sandbox Code Playgroud)

(注意到在2011年,1月有六周,因此第6周(根据某些定义)是在第1个月).