Programmierer aus Leidenschaft. Ich lege besonders Wert auf Clean Code und liebe es mich durch legacy Code zu wΓΌhlen... und den dann zu refaktorieren π.
// open the file in read mode$file=fopen('data/classic-composers.csv',"r");$headline=null;// browse each csv linewhile(($row=fgetcsv($file))!==false){if($headline===null){$headline=$row;continue;}$data=array_combine($headline,$row);// print the line contentprint_r($data);}// close the filefclose($handle);
Array
(
[First name] => Carl Philipp Emanuel
[Last name] => Bach
[Born] => 8 March 1714
[Died] => 14 December 1788
)
I β₯οΈ to dig into problems and to craft products creating value for users & businesses. Entrepreneur, software engineer, product folk, open source believer, game jam addict.
I prefer an associative array π:
Good point, same here, thank you for the comment! π