I have a csv file named data1.csv
. The first time i use php to read the csv file content I can get the contents correctly. The problem is I cannot read the new data after I update the data in data1.csv
. It keeps returning the previous data. What could be the wrong?
$file_handle = fopen($csvFile, 'r');
if(!$file_handle) die("Can't open file");
while (!feof($file_handle) ) {
$line_of_text[] = fgetcsv($file_handle, 0, $csv_spliter);
}
clearstatcache();
fclose($file_handle);
$file_content = $line_of_text;