|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-06-11 18:30 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2015-06-11 18:30 UTC] cmb@php.net
[2015-06-21 04:22 UTC] php-bugs at lists dot php dot net
[2015-06-21 13:28 UTC] richard at roguewavelimited dot com
[2015-06-21 13:39 UTC] cmb@php.net
-Status: No Feedback
+Status: Not a bug
[2015-06-21 13:39 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
Description: ------------ Using a tab delimiter with fgetcsv, if the last field of a row is empty, then that field is not included in the returned fields. (Actually in my tests, there can be any number of tabs following the last non-empty data field and all will be ignored.) For example: Correct: 1<tab>2<tab>3 returns array("1","2","3") Wrong: 1<tab>2<tab> returns array("1","2") should be returned as array("1","2","") If you perform this same test using commas as delimiters it works as expected. Test script: --------------- Paste this into a new file (be sure to include the trailing tab): T17492-RB "Delta Faucets" Change the data file name and run this script. The echo should show 3 but shows 2 $fh = fopen('the_data_file','r'); $fields = fgetcsv($fh, 999999, "\t", '"', "\\"); echo (count($fields));