|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-10-11 14:17 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 03:00:01 2025 UTC |
Description: ------------ The function fgetcsv has a problem when I parse a csv file. If you parse a csv for example with delimeter pipe ("|") and you backslashes a pipe, the function shouldn't take it that a delimeter. Reproduce code: --------------- csv_file.csv content: foo|foo_1\|foo_2 ---------------------------------- fgetcsv.php content: <?php $handle = fopen('csv_file.csv','r'); while(($line = fgetcsv($handle,1000,'|')) !== false) { print '<pre>'; print_r($line); print '</pre>'; } ?> Expected result: ---------------- Array ( [0] => foo [1] => foo_1|foo_2 ) Actual result: -------------- Array ( [0] => foo [1] => foo_1\ [2] => foo_2 )