note 77013 modified in function.fputcsv by danbrown

From: Date: Thu, 20 Nov 2008 14:40:01 +0000
Subject: note 77013 modified in function.fputcsv by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-146751@lists.php.net to get a copy of this message
A event simpler way: <?php function fputcsv($hFile, $aRow, $sSeparator=',', $sEnclosure='"') { foreach ($aRow as $iIdx=>$sCell) $aRow[$iIdx] = str_replace($sEnclosure, $sEnclosure.$sEnclosure, $sCell); fwrite($hFile, join($aRow, $sSeparator)."\n"); } ?> --was-- A event simpler way: function fputcsv($hFile, $aRow, $sSeparator=',', $sEnclosure='"') { foreach ($aRow as $iIdx=>$sCell) $aRow[$iIdx] = str_replace($sEnclosure, $sEnclosure.$sEnclosure, $sCell); fwrite($hFile, join($aRow, $sSeparator)."\n"); } http://php.net/manual/en/function.fputcsv.php

« previous php.notes (#146751) next »