public function csvToArray($filename = '', $delimiter = ','){
if(!file_exists($filename) || !is_readable($filename))
return false;
$header = null;
$data = array();
if(($handle = fopen($filename, 'r')) !== false){
while(($row = fgetcsv($handle, 1000, $delimiter)) !== false){
if(!$header)
$header = $row;
else
$data[] = array_combine($header, $row);
}
fclose($handle);
}
return $data;
}
$csv = array_map("str_getcsv", file("data.csv", "r"));
$header = array_shift($csv);
// Seperate the header from data
$col = array_search("Value", $header);
foreach ($csv as $row) {
$array[] = $row[$col];
}
$csv = array_map('str_getcsv', file('data.csv'));