I have a CSV file with different lines: ;0;1;0;4;5;M;468468;A1101;0090 0;1;0;4;5;M;468468;A1108;0090 And in a folder of photos that must have the naming format “A1101_0090-1.JPG” for the …
Tag: fgetcsv
How to display line by line a csv file in PHP with a particular structure? [closed]
I have this code that reads a csv file and displays it in this form : REFERENCE;COLOR;QUANTITY;TURNOVER;SELL TROUGH;COMMENT GJK0C9;8952;3;90;3%;Pack S GJKCS4;399;2;19;10%;Windows GSIJS5;9224;…
Getting every 7th element from array while echoing a table
I’m getting the data I need from fgetcsv and store them into $data. It contains a table with a header row and lot’s of info. Every 7th column is the path to where the file is stored. I’ve already …
PHP – fgetcsv loop for get data from csv file column by column
I have a CSV file with 31 columns and 24 rows. I need with fgetcsv (or maybe another solution) to pass in the CSV and get data column by column. I have one solution: The for loop is working but $data[$col] only gets data from the first column of the CSV, it doesn’t get data from $data[$col] when $col is
php://memory IO stream and fgetcsv()
I want to parse csv-like string so I can emulate csv and assert it into a test case. But it won’t parse into arrays. This is the output: Answer Remove the rn, not needed Your moving the pointer twice per loop, change to $parsed[] = $data
Finding duplicate column values in a CSV
I’m importing a CSV that has 3 columns, one of these columns could have duplicate records. I have 2 things to check: So far, I’m parsing the CSV file, once and checking that 1. (NAME is valid), which if it fails, it simply breaks out of the while loop and stops. I guess the question is, how I’d check that