From 376417834e593ad875ca3d9a1311e0f072619319 Mon Sep 17 00:00:00 2001 From: Peter Cowburn Date: Thu, 26 Apr 2012 21:21:29 +0000 Subject: [PATCH] document SplFileObject::fputcsv() (doc #60878) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@325467 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/spl/splfileobject/fputcsv.xml | 83 +++++++++++++++++++++---- reference/spl/versions.xml | 1 + 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/reference/spl/splfileobject/fputcsv.xml b/reference/spl/splfileobject/fputcsv.xml index db026b2e89..d428bcba60 100644 --- a/reference/spl/splfileobject/fputcsv.xml +++ b/reference/spl/splfileobject/fputcsv.xml @@ -4,23 +4,20 @@ SplFileObject::fputcsv - Output a field array as a CSV line + Write a field array as a CSV line &reftitle.description; public intSplFileObject::fputcsv - stringfields - stringdelimiter - stringenclosure + arrayfields + stringdelimiter',' + stringenclosure'"' - + Writes the fields array to the file as a CSV line. - - &warn.undocumented.func; - @@ -30,7 +27,7 @@ fields - + An array of values. @@ -38,7 +35,8 @@ delimiter - + The optional delimiter parameter sets the field + delimiter (one character only). @@ -46,7 +44,8 @@ enclosure - + The optional enclosure parameter sets the field + enclosure (one character only). @@ -56,10 +55,70 @@ &reftitle.returnvalues; - + Returns the length of the written string&return.falseforfailure;. + + + Returns &false;, and does not write the CSV line to the file, if the + delimiter or enclosure + parameter is not a single character. + + &reftitle.errors; + + An E_WARNING level error is issued if the + delimiter or enclosure + parameter is not a single character. + + + + + &reftitle.examples; + + + <methodname>SplFileObject::fputcsv</methodname> example + +fputcsv($fields); +} + +?> +]]> + + The above example will write the following to file.csv: + + + + + + + + + &reftitle.seealso; + + + fputcsv + SplFileObject::fgetcsv + + + diff --git a/reference/spl/versions.xml b/reference/spl/versions.xml index a46f0974c7..3390e792f6 100644 --- a/reference/spl/versions.xml +++ b/reference/spl/versions.xml @@ -704,6 +704,7 @@ +