ID: 12337 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Linux RedHat 6.2 PHP Version: 4.0.4pl1 New Comment:
This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-02-10 19:27:33] [EMAIL PROTECTED] Whitespace characters (be they space, tab, or newline, etc.) in the format string matche one or more whitespace characters in the input. So the second \t in your format string is matching the space between 'def' and 'ghi.' The sample file from the documentation does not include "embedded whitespace" in the different data columns as yours does. I'm changing this to a documentation problem because the (f)scanf documentation is really lacking. Sean ------------------------------------------------------------------------ [2001-07-24 09:45:17] [EMAIL PROTECTED] When I copy&paste sample from documentation of fscanf function, I found, that it work incorrectly: Sample: while ($userinfo = fscanf ($fp, "%s\t%s\t%s\n")) { list ($name, $profession, $countrycode) = $userinfo; } Sample file: abc<tab>def ghi jkl<tab> ..... <newline> Note: <tab> means here a "tabelator" character (\t) Result: $name = 'abc' $profession = 'def'; $contrycode = 'jkl'; I expect: $name = 'abc' $profession = 'def ghi jkl'; $contrycode = ' .... '; What si wrong??? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=12337&edit=1
