[php-src] Issue #8093: Unexpected behavior when parsing csv
| From: | cmb69 | Date: | Mon, 14 Feb 2022 10:06:38 +0000 |
| Subject: | [php-src] Issue #8093: Unexpected behavior when parsing csv | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239758@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8093
Comment Author: cmb69
The trailing linebreak after reading is caused by the proprietary escape mechanism; I don't
think we can "fix" the behavior for BC reasons. However, as of PHP 7.4.0, you can pass an
empty string as
$escape which yields the desired behavior:
````php
$dataAfter = fgetcsv($handle, null, ",", "\"", "");
````