[doc-en] master: Another fgetscv proprietary description. (#5101)
| From: | alfsb via GitHub | Date: | Wed, 14 Jan 2026 21:30:57 +0000 |
| Subject: | [doc-en] master: Another fgetscv proprietary description. (#5101) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-22951@lists.php.net to get a copy of this message | ||
Author: alfsb (alfsb)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-01-14T21:30:54Z
Commit: https://github.com/php/doc-en/commit/3a89b55d11aedec72ff17b21c7daa95571dfd3ae
Raw diff: https://github.com/php/doc-en/commit/3a89b55d11aedec72ff17b21c7daa95571dfd3ae.diff
Another fgetscv proprietary description. (#5101)
Co-authored-by: André L F S Bacci <ae@php.net>
Changed paths:
M reference/spl/splfileobject/fgetcsv.xml
Diff:
diff --git a/reference/spl/splfileobject/fgetcsv.xml b/reference/spl/splfileobject/fgetcsv.xml
index f149533eb638..f3ba803a6371 100644
--- a/reference/spl/splfileobject/fgetcsv.xml
+++ b/reference/spl/splfileobject/fgetcsv.xml
@@ -57,13 +57,17 @@
</para>
<warning>
<simpara>
- Inside an <parameter>enclosure</parameter>, the
<parameter>enclosure</parameter> character can always be
<parameter>escaped</parameter> by doubling it,
- resulting in a single <parameter>enclosure</parameter> character in the parsed
result.
- The <parameter>escaped</parameter> character works differently:
- If it is followed by an <parameter>enclosure</parameter> character then that
<parameter>enclosure</parameter> character will not be treated as one,
- however the <parameter>escaped</parameter> character itself remains. So for the
default parameters, <literal>""</literal>
- inside an <parameter>enclosure</parameter> will be parsed into
<literal>",</literal> while <literal>\"</literal> inside an
- <parameter>enclosure</parameter> will be parsed into
<literal>\"</literal>.
+ In the input stream, the <parameter>enclosure</parameter> character
+ can always be escaped by doubling it inside a quoted string,
+ resulting in a single <parameter>enclosure</parameter> character
+ in the parsed result.
+ The <parameter>escape</parameter> character works differently:
+ If a sequence of <parameter>escape</parameter> and
+ <parameter>enclosure</parameter> characters appear in the stream,
+ both characters will be present in the parsed value.
+ So for the default parameters, <literal>""</literal>
+ in quoted strings will be parsed as <literal>"</literal>, while
+ <literal>\"</literal> parsed as <literal>\"</literal>.
</simpara>
</warning>
<warning>
@@ -90,7 +94,7 @@
<note>
<para>
A blank line in a CSV file will be returned as an array
- comprising a single &null; field unless using <constant>SplFileObject::SKIP_EMPTY |
SplFileObject::DROP_NEW_LINE</constant>,
+ comprising a single &null; field unless using <constant>SplFileObject::SKIP_EMPTY |
SplFileObject::DROP_NEW_LINE</constant>,
in which case empty lines are skipped.
</para>
</note>