$timestamp = time(); //任意日期时间戳 $week = abs(ceil((date('j', $timestamp) - [0,6,5,4,3,2,1][date('w', strtotime(date('Y-m-01')))]) / 7));