CVS update: php3/doc/functions
| From: | kk | Date: | Wed, 09 Jun 1999 11:20:38 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6762@lists.php.net to get a copy of this message | ||
Date: Wednesday June 9, 1999 @ 7:20
Author: kk
Update of /repository/php3/doc/functions
In directory php:/tmp/cvs-serv890/doc/functions
Modified Files:
filesystem.sgml
Log Message:
- Fix bug 1517.
- Add optional delimiter character to fgetcsv() as third parameter.
- Change documentation to reflect that.
Index: php3/doc/functions/filesystem.sgml
diff -u php3/doc/functions/filesystem.sgml:1.49 php3/doc/functions/filesystem.sgml:1.50
--- php3/doc/functions/filesystem.sgml:1.49 Thu May 27 10:14:27 1999
+++ php3/doc/functions/filesystem.sgml Wed Jun 9 07:20:37 1999
@@ -375,10 +375,13 @@
<funcdef>array <function>fgetcsv</function></funcdef>
<paramdef>int <parameter>fp</parameter></paramdef>
<paramdef>int <parameter>length</parameter></paramdef>
+ <paramdef>string
<parameter><optional>delimiter</optional></parameter></paramdef>
</funcsynopsis>
<simpara>
Similar to fgets() except that fgetcsv() parses the line it reads for
fields in CSV format and returns an array containing the fields read.
+ The field delimiter is a comma, unless you specifiy another
+ delimiter with the optional third parameter.
<simpara>
fp must be a valid file pointer to a file successfully opened by
<function>fopen</function>, <function>popen</function>, or
<function>fsockopen</function>
@@ -396,7 +399,7 @@
<programlisting>
$row=1;
$fp = fopen("test.csv","r");
-while ($data = fgetcsv($fp,1000)) {
+while ($data = fgetcsv($fp,1000, ",")) {
$num = count($data);
print "<p> $num fields in line $row: <br>";
$row++;