note 110582 added to function.str-getcsv

From: Date: Fri, 09 Nov 2012 13:35:33 +0000
Subject: note 110582 added to function.str-getcsv
Groups: php.notes 
Request: Send a blank email to php-notes+get-191823@lists.php.net to get a copy of this message
The solution from w_barath at hotmail dot com does not work if there is no enclosure. The first char in the first field and the last char in the last field will be skipped. It can be solved by adding this line as the first line in the function: if($enclosure=='') $input = '"' . $input . '"'; This will ensure there is "something" to cut off by substring(). ---- Server IP: 69.147.83.199 Probable Submitter: 212.242.137.7 ---- Manual Page -- http://www.php.net/manual/en/function.str-getcsv.php Edit -- https://master.php.net/note/edit/110582 Del: integrated -- https://master.php.net/note/delete/110582/integrated Del: useless -- https://master.php.net/note/delete/110582/useless Del: bad code -- https://master.php.net/note/delete/110582/bad+code Del: spam -- https://master.php.net/note/delete/110582/spam Del: non-english -- https://master.php.net/note/delete/110582/non-english Del: in docs -- https://master.php.net/note/delete/110582/in+docs Del: other reasons-- https://master.php.net/note/delete/110582 Reject -- https://master.php.net/note/reject/110582 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#191823) next »