<?php
$content = <<<EOF
"name";"age";"drink"
"Paul";"22";"Mate"
"Frank";"40";"Cola"
"Angel";"2";"Juice"
EOF;
$file = __DIR__ . '/data.csv';
file_put_contents($file, $content);
$fobject = new SplFileObject($file);
$fobject->setFlags(SplFileObject::READ_CSV);
$fobject->setCsvControl(';', '"');
$data = [];
foreach($fobject as $line) {
$data[] = $line;
}
echo '<pre>' . print_r($data, true) . '</pre>';
Array ( [0] => Array ( [0] => name [1] => age [2] => drink ) [1] => Array ( [0] => Paul [1] => 22 [2] => Mate ) [2] => Array ( [0] => Frank [1] => 40 [2] => Cola ) [3] => Array ( [0] => Angel [1] => 2 [2] => Juice ) )