I have function export_csv()to export file as .csv format. I want to change .dat or .txt format instead of .csv
export_csv()
Current code:
public function
fwrite takes a string, not an array. Try something like this:
fwrite
fwrite($df, implode(', ', $row));