Doc #80193 [Opn->Csd]: Sample code correction
Edit report at https://bugs.php.net/bug.php?id=80193&edit=1
ID: 80193
Updated by: cmb@php.net
Reported by: shaun at slickdesign dot com dot au
Summary: Sample code correction
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Website problem
PHP Version: 7.4.11
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The code has been fixed. It will take a while until the change is
rolled out to the Website.
Previous Comments:
------------------------------------------------------------------------
[2020-10-07 07:43:41] shaun at slickdesign dot com dot au
Description:
------------
Hi Team,
It's been pointed out to me that I have an error in the sample code of one of my comments and I
am unsure how to correct the issue. The comment is question is one I submitted about 2 years ago,
and it can be found here:
https://www.php.net/manual/en/function.fgetcsv.php#122696
I'm unsure if the example I provided is how I would do things now, but the point remains that
the sample code does not work because one of the variable names is incorrect.
The line in question is as follows:
if (fgets($fp, 4) !== $fp) {
The correction would be to change the second variable from $fp to $bom. Example:
if (fgets($fp, 4) !== $bom) {
If you are able to correct my mistake, that would be greatly appreciated.
Thanks, Shaun.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80193&edit=1
Thread (2 messages)