Jump to content

jonnyfortis

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by jonnyfortis

  1. i have a student register for attendance, down the side will be their names, across the top i will be showing each single day (example tuesday) from three month date range currently the code just echoes out all the Tuesdays as an array from the three month date range. i need to be able to use the individual date to add them to the database based on weather they student has attended. i know how to do this i just need to know how i can use the dates individually. function getDatesFromRange($start, $end) { $interval = new DateInterval('P1D'); $realEnd = new DateTime($end); $realEnd->add($interval); $period = new DatePeriod( new DateTime($start), $interval, $realEnd ); foreach($period as $date) { $array[] = $date->format('Y-m-d'); } return $array; } // Call the function $dates = getDatesFromRange('2016-04-01', '2016-07-01'); // Print the output print_r($dates);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.