Tag Archives: csv

Add special characters to CSV export in PHP

Description: When exporting data to CSV, the special characters are not displayed, as the ending ; is treated as a new column. Solution: Check the encoding of the CSV file. Make sure this is utf-8. However, in some cases this … Continue reading

Posted in PhP, Tools | Tagged , , , | Leave a comment

Parse CSV file in PHP and retrieve contents

Description: Retrieve CSV file contents in PHP. Solution: The parsing is done in 2 steps. First read the .csv file: $handle = fopen(“file.csv”, “r”); $csv = array(); while(($data = fgetcsv($handle)) !== FALSE) { // get the values from the csv … Continue reading

Posted in PhP, Tools | Tagged | Leave a comment

Create and download file without saving on server

Description: How to create a file on the server without saving it, just giving the user the possibility to open it or save it on the local machine? Solution: First, create the file contents as you would do normally. Then … Continue reading

Posted in PhP, Tools | Tagged , , | 4 Comments