note 34293 added to function.fgetcsv

From: Date: Mon, 21 Jul 2003 17:00:32 +0000
Subject: note 34293 added to function.fgetcsv
Groups: php.notes 
Request: Send a blank email to php-notes+get-52460@lists.php.net to get a copy of this message
You should pay attention to the fact that "fgetcsv" does remove leading TAB-chars "chr(9)" while reading the file. This means if you have a chr(9) as the first char in the file and you use fgetcsv this char is automaticaly deleted. Example: file content: chr(9)first#second#third#fourth source: $line = fgetcsv($handle,500,"#"); The array $line looks like: $line[0] = first $line[1] = second $line[2] = third $line[3] = fourth and not $line[0] = chr(9)first $line[1] = second $line[2] = third $line[3] = fourth All chr(9) after another char is not deleted! Example: file content: Achr(9)first#second#third#fourth source: $line = fgetcsv($handle,500,"#"); The array $line looks like: $line[0] = Achr(9)first $line[1] = second $line[2] = third $line[3] = fourth ---- Manual Page -- http://www.php.net/manual/en/function.fgetcsv.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34293 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34293&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34293&report=yes

« previous php.notes (#52460) next »