- var_dump: documentation ( source)
- iterator_to_array: documentation ( source)
<?php
$tmp = new SplTempFileObject();
$tmp->fwrite("a,b".PHP_EOL."3,11\n");
$tmp->setFlags(SplTempFileObject::READ_CSV|SplTempFileObject::READ_AHEAD|SplTempFileObject::SKIP_EMPTY);
$res = iterator_to_array($tmp);
var_dump($res);