svn: /phpdoc/en/trunk/reference/filesystem/functions/ fputcsv.xml
| From: | Peter Cowburn | Date: | Mon, 23 Aug 2010 21:50:12 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/filesystem/functions/ fputcsv.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7037@lists.php.net to get a copy of this message | ||
salathe Mon, 23 Aug 2010 21:50:12 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=302723
Log:
better basic example for fputcsv (doc #52680)
Bug: http://bugs.php.net/52680 (Open) Documentation examples
uses a deprecated function
Changed paths:
U phpdoc/en/trunk/reference/filesystem/functions/fputcsv.xml
Modified: phpdoc/en/trunk/reference/filesystem/functions/fputcsv.xml
===================================================================
--- phpdoc/en/trunk/reference/filesystem/functions/fputcsv.xml 2010-08-23 21:24:26 UTC (rev 302722)
+++ phpdoc/en/trunk/reference/filesystem/functions/fputcsv.xml 2010-08-23 21:50:12 UTC (rev 302723)
@@ -79,21 +79,30 @@
<?php
$list = array (
- 'aaa,bbb,ccc,dddd',
- '123,456,789',
- '"aaa","bbb"'
+ array('aaa', 'bbb', 'ccc', 'dddd'),
+ array('123', '456', '789'),
+ array('"aaa"', '"bbb"')
);
$fp = fopen('file.csv', 'w');
-foreach ($list as $line) {
- fputcsv($fp, split(',', $line));
+foreach ($list as $fields) {
+ fputcsv($fp, $fields);
}
fclose($fp);
?>
]]>
</programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+aaa,bbb,ccc,dddd
+123,456,789
+"""aaa""","""bbb"""
+
+]]>
+ </screen>
</example>
</para>
</refsect1>