note 111902 added to function.fgetcsv

From: Date: Wed, 10 Apr 2013 10:56:41 +0000
Subject: note 111902 added to function.fgetcsv
Groups: php.notes 
Request: Send a blank email to php-notes+get-194426@lists.php.net to get a copy of this message
I have data in phpmyadmin, example: ||from||to||messages|| ||john||andy||meeting now|| ||dony||sherly||Place in \"Jakarta\" , Indonesia, 15412 when I export to csv via phpmyadmin version 3.5.6, I get this csv file: "from","to","messages" "john","andy","meeting now" "from","to","Place in \""Jakarta\"" , Indonesia, 15412" if I use this code <?php // code start $file = fopen($path, 'r'); while (($line = fgetcsv($file)) !== FALSE) { print_r($line); } fclose($file); // code end ?> I hope get this //output start Array ( [0] => from [1] => to [2] => messages ) Array ( [0] => john [1] => andy [2] => meeting now ) Array ( [0] => dony [1] => sherly [2] => Place in \"Jakarta\" , Indonesia, 15412 ) //output end but instead I get //output start Array ( [0] => from [1] => to [2] => messages ) Array ( [0] => john [1] => andy [2] => meeting now ) Array ( [0] => from [1] => to [2] => Place in \"Jakarta\"" [3] => Indonesia [4] => 15412" ) //output end anyone can help this error? ---- Server IP: 69.147.83.199 Probable Submitter: 152.118.24.10 (proxied: 152.118.82.25) ---- Manual Page -- http://php.net/manual/en/function.fgetcsv.php Edit -- https://master.php.net/note/edit/111902 Del: integrated -- https://master.php.net/note/delete/111902/integrated Del: useless -- https://master.php.net/note/delete/111902/useless Del: bad code -- https://master.php.net/note/delete/111902/bad+code Del: spam -- https://master.php.net/note/delete/111902/spam Del: non-english -- https://master.php.net/note/delete/111902/non-english Del: in docs -- https://master.php.net/note/delete/111902/in+docs Del: other reasons-- https://master.php.net/note/delete/111902 Reject -- https://master.php.net/note/reject/111902 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194426) next »