- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$year = date('Y');
$week_count = date('W', strtotime($year . '-12-31'));
if ($week_count == '01')
{
$week_count = date('W', strtotime($year . '-12-24'));
}
echo $week_count;