Answers for "column of csv to array php"

PHP
0

column of csv to array php

$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]; 
}
Posted by: Guest on October-30-2020
0

csv to array php

$csv = array_map('str_getcsv', file('data.csv'));
Posted by: Guest on April-05-2021

Browse Popular Code Answers by Language