https://www.virendrachandak.com/techtalk/creating-csv-file-using-php-and-mysql/
How to create CSV file using PHP