php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29278 fgetcsv() problems with \ at the end of a field
Submitted: 2004-07-20 12:59 UTC Modified: 2004-07-20 23:47 UTC
From: jens at girbert dot de Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.7 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jens at girbert dot de
New email:
PHP Version: OS:

 

 [2004-07-20 12:59 UTC] jens at girbert dot de
Description:
------------
When reading a comma separated file with fgetcsv, the function does not split the fields correctly in following conditions:

-backslash \ at the end of a field
and
-fields are enclosed by ""

the following line from the csv-file is read with a wrong result:

"test1\","test2","test3"

There are only 2 fields in the array returned by fgetcsv:

[0] => test1\",test2
[1] => test3

Expected is:

[0] => test1\
[1] => test2
[2] => test3



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-20 23:47 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Escaping " makes the parser skip over that character. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 01:01:36 2024 UTC