generate functionFri, 27 Jan 2023

import csv from local file and put values into an array, remove header line, and loop through the array

function readCsv($fileName) { $file = fopen($fileName, 'r'); $header = fgetcsv($file); while($row = fgetcsv($file)) { $rows[] = $row; } fclose($file); return $rows; }

Questions about programming?Chat with your personal AI assistant