In this example I am going to show and brief my implementation of validating CSV row content with custom CSV Content Validation rule created in FormRequest in my Laravel application. Scenario I need to create a simple custom CSV importer…
Tag: csv
PHP – Fix apostrophe(‘) converting to entity ' in csv export
1) If you read a .csv file for download: use \xEF\xBB\xBF after headers and just before you echo file data. For example: echo “\xEF\xBB\xBF”; // UTF-8 BOM readfile($file); 2) If you echo per line use htmlspecialchars_decode to covert single and…
Converting a text string into comma separated words
Today, i was looking at some old code of mine to find something when i found this little but useful piece of code which i had written for one of my old projects (and of course when i didn’t had…
Spliting CSV (comma seperated) entry grouped by double quotes
By using fgetcsv function we can have well formatted output for csv data without any pain. If you don’t want to use fgetcsv function for some reason and your CSV comma separated entries may contain comma inside except the delimiters,…