I want to take a date and work out its week number.
So far, I have the following. It is returning 24 when it should be 42.
try this solution
date( 'W', strtotime( "2017-01-01 + 1 day" ) );