I'm having the following csv file
$file = file_get_contents($url);
// file
Date,Value1,Value2
17-Nov-17,34,42
16-Nov-17,22,35
15-Nov-17,19,24
$csv = explode("\n", $file);
// dump
array:10 [▼
0 => "Date,Value1,Value2
1 => "17-Nov-17,34,42"
2 => "16-Nov-17,22,35"
3 => "15-Nov-17,19,24"
]
What I want to do is to display the content of the csv file into a html-table, but first I want to convert this to an associative array. How can I do this? Does PHP provide a build-in function for this?