$days = round( ( strtotime('2020-01-10') - strtotime('2020-01-01') ) / (60 * 60 * 24) ); echo $days; // 9