im been looking in to php array_column and array_map but i still dont get it!.
This is the code i use for loading my CSV
<?PHP
$row = 1;
$faq = array(); //define the main array.
if (($handle = fopen("file.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c = 0; $c < $num; $c++) {
}
$faq[] = $data; //add the row to the main array.
}
fclose($handle);
}
?>
And this is is how i output the data:
echo $faq[1][13];
So the [1] is the row and the [13] is the column.
But if that info is not longer on the row [1] but i still want to finds that data. So if we say column and row 0 is a ID/header and i could write
echo $faq['printing']['Hash_tag'];
['printing'] = would mean the row it finds that word on column 0
['Hash_tag'] = would mean the column "13" where it finds that on the top row.
For sure this is a duplicate but i been looking in to this for a long time and im almost giving up as i cant figure it out.