note 115543 added to function.fputcsv

From: Date: Wed, 13 Aug 2014 01:32:41 +0000
Subject: note 115543 added to function.fputcsv
Groups: php.notes 
Request: Send a blank email to php-notes+get-200179@lists.php.net to get a copy of this message
if you want to change the line endings for fputcsv to \r\n. after you call fputcsv add a fseek with ftell then fputs the line ending you want example $fp = fopen($file, 'w+'); //add BOM to fix UTF-8 in Excel fputs($fp, chr(0xEF) . chr(0xBB) . chr(0xBF) ); foreach($data as $fields) { fputcsv($fp, $fields); fseek($fp, ftell($fp)-1); fputs($fp, "\r\n"); } fclose($fp) ---- Server IP: 72.52.91.14 Probable Submitter: 68.190.222.249 ---- Manual Page -- http://php.net/manual/en/function.fputcsv.php Edit -- https://master.php.net/note/edit/115543 Del: integrated -- https://master.php.net/note/delete/115543/integrated Del: useless -- https://master.php.net/note/delete/115543/useless Del: bad code -- https://master.php.net/note/delete/115543/bad+code Del: spam -- https://master.php.net/note/delete/115543/spam Del: non-english -- https://master.php.net/note/delete/115543/non-english Del: in docs -- https://master.php.net/note/delete/115543/in+docs Del: other reasons-- https://master.php.net/note/delete/115543 Reject -- https://master.php.net/note/reject/115543 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200179) next »