|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-06-23 22:53 UTC] moriyoshi@php.net
[2004-06-23 22:53 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 09:00:01 2025 UTC |
Description: ------------ Pass a variable to the delimiter and enclosure of the fgetcsv returns the error: Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in .... It seems that it will only accept it hard coded: fgetcsv($handle, 2000, ",", '') All a bit wierd! Used the latest CVS Works in 4.3.7 Reproduce code: --------------- function csv_import($file, $delimiter = ",", $enclosure='') { $handle = fopen($file, "r"); $csv_arr = array(); while (($data_arr = fgetcsv($handle, 2000, $delimiter, $enclosure)) !== FALSE) { $csv_arr[] = $data_arr; $row++; } fclose($handle); } Expected result: ---------------- No error