|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-05 10:43 UTC] derick@php.net
[2009-08-05 11:01 UTC] axel77 at gmail dot com
[2009-08-05 14:33 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
Description: ------------ I was using '?' as closure, since this was the only character I fairly didn't even expect to encounter, without having to use any escaping. It does not work. It will always add an additional trailing '?' on the data received. Reproduce code: --------------- --- reproduce.php --- <html> <style type="text/css"> table {border-collapse: collapse;} td {border: 1px solid;} </style> <body><table><tbody> <?php if (($handle = fopen('data', 'r')) === FALSE) { echo '<h1>ERROR: Unable to read data.</h1>'; exit; } while (($data = fgetcsv($handle, 1000, ',', '?')) !== FALSE) { echo "<tr><td>$data[0]</td>"; echo "<td>$data[1]</td>"; echo "<td>$data[2]</td></tr>"; } fclose($handle); ?> </tbody></table></body></html> ----------------- --- data --- abm, ?anjn an?, aaa abm, anjn an, aaa ----------------- Expected result: ---------------- abm | anjn an | aaa abm | anjn an | aaa Actual result: -------------- abm | anjn an? | aaa abm | anjn an | aaa