|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-17 18:43 UTC] sniper@php.net
[2005-01-18 01:15 UTC] iliaa@php.net
[2005-01-18 01:15 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ Can't handle doubled-quote at the start of a quoted field when there is another field following. That is, does OK on the line: z,"""x" but not on the line: z,"""x",yyy Reproduce code: --------------- <?php $out = fopen("/tmp/csv", "w"); fputs($out, 'z,"""x"' . "\n"); fputs($out, 'z,"""x",yyy' . "\n"); fclose($out); echo "<pre>"; system("cat /tmp/csv"); echo "</pre>"; $in = fopen("/tmp/csv", "r"); while ($a = fgetcsv($in, 200)) echo "<br>" . htmlspecialchars($a[1]); fclose($in); ?> Expected result: ---------------- z,"""x" z,"""x",yyy "x "x Actual result: -------------- z,"""x" z,"""x",yyy "x x