php - Insert values into array -
multi-dimensional array: each record has title , array day of week key , value. i'm trying insert values according day of week (based on key) of existing array. code:
foreach($records $rec) { $row = array( 'title' => $rec['title'], 'monday' => '', 'tuesday'=> '', 'wednesday'=> '', 'thursday' =>'', 'friday' => ''); foreach($rec['dates'] $dtow) { $dow = explode(' ', $dtow)[0]; $value = explode(' ', $dtow)[1]; if($dow....blah blah that's i'm getting lost... } $data[] = $row; }
any advice appreciated.
edited: sorry, that's better...
event || monday || tuesday || wednesday || thursday || friday bthd || 12:00 || || 14:30 || || prty || || 18:45 || 17:30 || || 14:15 wdng || 9:00 || || || 13:30 ||
Comments
Post a Comment