for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Turahe\Master\Seeds;
class CsvtoArray
{
public function csv_to_array($filename, $header)
$delimiter = ',';
if (!file_exists($filename) || !is_readable($filename)) {
return false;
}
$data = [];
if (($handle = fopen($filename, 'r')) !== false) {
while (($row = fgetcsv($handle, 1000, $delimiter)) !== false) {
$data[] = array_combine($header, $row);
fclose($handle);
return $data;