Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
prog:php:samples:csv_parse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
prog:php:samples:csv_parse [2022/04/27 17:47] reneprog:php:samples:csv_parse [2023/11/10 16:01] (current) rene
Line 1: Line 1:
-One liner to get a CSV file into 2-dimentional array (NB! Only works if "," is the separator!!!):+One liner to get a CSV file into 2-dimentional array  
 +NB! Only works if "," is the separator!!! 
 +NB! Does not work if CSV cells have line breaks in them!!!
 <code php> <code php>
 $csv = array_map('str_getcsv', file('data.csv')); $csv = array_map('str_getcsv', file('data.csv'));
prog/php/samples/csv_parse.txt · Last modified: 2023/11/10 16:01 by rene