On Thu, 17 May 2001 08:26, Matthias Roggendorf wrote:
> Hi,
> I wrote some code and I do not understand the result I get:
>
> while ($data = fgetcsv ($fp, 1000, ",")) $line[$j++] = $data;
>
> When I ouput $line[0][0] I get Array[0] instead of the real value.
>
> Why is that?
>
> Thanks for your help,
>
> Matthias

>From the docs:

"Similar to fgets() except that fgetcsv() parses the line it reads for 
fields in CSV format and returns an array containing the fields read. The 
field delimiter is a comma, unless you specify another delimiter with the 
optional third parameter."

So it seems that $data will be an array of the current line being 
returned from the file? Have a look at the docs 
(/manual/en/function.fgetcsv.php) for an example of how to read and 
output the contents of a csv file.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   hAS ANYONE SEEN MY cAPSLOCK KEY?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to