ID: 28347 Updated by: [EMAIL PROTECTED] Reported By: andrew at shh dot fi Status: Open Bug Type: Filesystem function related Operating System: win32 PHP Version: 5.0.0RC2 New Comment:
With older releases, your code ends up with the same warning as with PHP 5. The behaviour seems somewhat changed in the recent releases of PHP 4. Not a bug. Previous Comments: ------------------------------------------------------------------------ [2004-05-10 10:48:03] andrew at shh dot fi 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28347&edit=1