/ Published in: PHP
This code reads a CSV file and extracts each item into the appropriate variable for processing.
Expand |
Embed | Plain Text
Comments
Subscribe to comments
You need to login to post a comment.
tylerhall on 08/07/06
data import textmate read csv excel
45 people have marked this snippet as a favorite
yuconner
exor674
irdial
jmontano
halbtuerke
hudge
vali29
apocalip
JimiJay
cristianciofu
chucktrukk
romanos
sumandahal
stavelin
discorax
Jdub7
thermosilla
bryandease
gdvickery
Anber
irishsk
nb109
Hollow
marnold2000
sultano
mattnews
kellyrmartin
willwish
mblarsen
m0d
fyreflyX
osirisinternet
sofcase
jetm
pablo808
tspitzr
warren
ceedoo
lfcortes
qubestream
Briantjuh
bhasunjaya
localsearchguy
candicom
itsmeameer
This code reads a CSV file and extracts each item into the appropriate variable for processing.
Subscribe to comments
You need to login to post a comment.
/Users/Heike/Desktop/250K-f10-080608.csv.download
Just as a pointer, calling fgetcsv() using the length of 1000 MUST ensure that the longest line is at MOST 1000 characters long. Also, for generally large CSV files, calling list() to load column into a variable may not be advantageous...the $data variable returned is an indexed array of each column.
Here's also a good tutorial on How To Upload a CSV file and Save To Database using PHP -->> http://www.upgradedtutorials.info/tutorials/how-to-upload-a-csv-file-and-save-to-database-using-php/