ID:          21556
 Updated by:  [EMAIL PROTECTED]
 Reported By: [EMAIL PROTECTED]
-Status:      Feedback
+Status:      Closed
 Bug Type:    Filesystem function related
 PHP Version: 4.3.0
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2003-01-09 17:10:41] [EMAIL PROTECTED]

I've just commited a patch to the CVS that may resolve the problem,
please wait a few hours and then grab a snapshot from
http://snaps.php.net/.

------------------------------------------------------------------------

[2003-01-09 16:32:39] [EMAIL PROTECTED]

Yeah,

Just copy this text to a file and then save it as test.csv

just a bunch of data, jere, fadjsfd, aksjfllsd, adfjsdkl
fajsdlfls, afdlsfkjfdsal, adjfsljfas, adfjsldkfjs, dkslafj
fjadskjf, aksdjfls, afksfdjl""", jlkjl, jlkjkl, jlkjl, jlak
fajlsd, jfadlsl, ajfldsja, akfjsdl, ajsdflj, ajdskfks
as you will see it hangs on the third line

------------------------------------------------------------------------

[2003-01-09 16:24:37] [EMAIL PROTECTED]

Could you please provide a sample csv file that could be used to
replicate the problem.

------------------------------------------------------------------------

[2003-01-09 16:01:36] [EMAIL PROTECTED]

Usings the basic fgetcsv example, 


<?php
$row = 1;
$fp = fopen ("test.csv","r");
while ($data = fgetcsv ($fp, 1000, ",")) {
    $num = count ($data);
    print "<p> $num fields in line $row: <br>\n";
    $row++;
    for ($c=0; $c < $num; $c++) {
        print $data[$c] . "<br>\n";
    }
}
fclose ($fp);
?>
If the CSV contains a double quote, fgetcsv hangs on that line and
memory utilization spikes.  I have reproduced this.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21556&edit=1

Reply via email to