Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

[PHP3] csv file From: Glenn MacGregor (gtm <email protected>)
Date: 05/02/00

Hi All,

    I need to read in a csv file line by line and get the data. I can
read it fine with fgetcsv and fgets. fgetcsv would be great except that
if a cell has a comma in it the data gets quoted in the csv. fgtecsv
doesn't handle this case. So I am using fgets which leaves the line
alone. Two questions, how do I strip the newline off, because it comes
back with it. And how can I handle the quoted case? If I do an explode
on " I don't know which elements were quoted. Can I access a string
like s[0], s[1]?

        Thanks

                    Glenn

--

Glenn MacGregor

Director of Services Oracom, Inc. http://www.oracom.com

Tel. +1 978.557.5710 Ext. 302 Fax +1 978.557.5716

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>