read csv file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lordrt
Forum Commoner
Posts: 34
Joined: Sun Jul 19, 2009 11:44 pm

read csv file

Post by lordrt »

I want to read a csv file in the following format line-by-line:

line1. 1,2,3,4,5,6,7,8,9,10
line2. 11,12,13,14,15,16
.
.
lineN. (some values)


Can anyone help plz :?:
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Re: read csv file

Post by Luke »

lordrt
Forum Commoner
Posts: 34
Joined: Sun Jul 19, 2009 11:44 pm

Re: read csv file

Post by lordrt »

thx but am reading but getting confused. Do I have to specify which delimiter is being used? When reading a normal file we use fgets to read a line, is fgetcsv same as fgets? :|
towerspl
Forum Newbie
Posts: 20
Joined: Mon Aug 03, 2009 7:37 am

Re: read csv file

Post by towerspl »

the link he provided explains everything on the page

Similar to fgets() except that fgetcsv() parses the line it reads for fields in CSV format and returns an array containing the fields read.


try reading a little
Post Reply