$this_year = date('Y');
$days_this_year = 365 + date('L');
$day_number = date('z') + 1;
Can I make an array instead of calling date() 3 times? I tried a few times, but could not figure out the syntax I needed
$this_year = date('Y');
$days_this_year = 365 + date('L');
$day_number = date('z') + 1;
Can I make an array instead of calling date() 3 times? I tried a few times, but could not figure out the syntax I needed
This approach creates a string with the values separated by spaces and explodes it into an array.
$values = date('Y L z');
$items = explode(' ',$values);
echo 'Year: '.$items[0].PHP_EOL;
echo 'Days this year: '.($items[1]+365).PHP_EOL;
echo 'Day number: '.$items[2].PHP_EOL;