|
Posted by Mark Rees on 10/12/05 13:09
> > I have a few products stored in a csv file created in Excel. Column 1
> > is the part #, column 2 is title, column 3 is color, column 4 is width
> > and 5 is price.
> >
> > I need to read these into arrays, with a seperate array for each
> > column.
> >
>
> Try something like this:
> 1) find out what the end-of-line is. Probably \n
> 2) read the csv into an array using file().
> Now each arrayelement is a row from the csv.
> check www.php.net for details.
>
> 3) Explode each line, using the seperator for columns. (can be tab \t or ,
> or whatever you decided.)
Hello
have a look at this function, and see if it helps you
http://uk2.php.net/manual/en/function.fgetcsv.php
Cheers
Mark
Navigation:
[Reply to this message]
|