> The for loop iterates through each field of each line, the while loop
> iterates through each line. Move the out of the for loop, right
> before the end of the while loop as follows:
> $row = 1;
> $handle = fopen("try3.csv", "r");
> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
>
The for loop iterates through each field of each line, the while loop
iterates through each line. Move the out of the for loop, right
before the end of the while loop as follows:
$num fields in line $row: \n";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . " "; // This will
On 3/20/2009 2:37 PM, "kirk.john...@zootweb.com"
wrote:
> revDAVE wrote on 03/20/2009 03:11:00 PM:
>
>> Newbie ... I'm trying to Trying to read / show a csv file line by line
> ...
>
> fgetcsv is your friend.
>
> http://us.php.net/manual/en/function.fgetcsv.php
Thanks Kirk for your help
revDAVE wrote on 03/20/2009 03:11:00 PM:
> Newbie ... I'm trying to Trying to read / show a csv file line by line
...
fgetcsv is your friend.
http://us.php.net/manual/en/function.fgetcsv.php
Kirk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/uns
Newbie ... I'm trying to Trying to read / show a csv file line by line ...
I think that a csv file would have a line delim of chr(10) or chr(13) or
something ... Fgets doesn't seem to see it
Q: How do I get it to see 1 line at a time and display it with in
between?
Thanks in advance...
5 matches
Mail list logo