Lets say I have a text field with the following data. Lines starting with #
are comments. The first line is the column headers and values are comma separated.
# some instruction
# some instruction
Day,Open,Close
Monday,09:00,17:00
Tuesday,09:00,18:00
How can I explode this to get an array like this:
$openingTimes = [
['Day' => 'Monday', 'Open' => '09:00', 'Close' => '17:00'],
['Day' => 'Tuesday', 'Open' => '09:00', 'Close' => '18:00'],
];