Bug #12337: Function fscanf does not correctly handle "\t" in format string
| From: | premysl dot dedic at conquest dot cz | Date: | Tue, 24 Jul 2001 13:45:17 +0000 |
| Subject: | Bug #12337: Function fscanf does not correctly handle "\t" in format string | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-60854@lists.php.net to get a copy of this message | ||
From: premysl.dedic@conquest.cz
Operating system: Linux RedHat 6.2
PHP version: 4.0.4pl1
PHP Bug Type: Filesystem function related
Bug description: Function fscanf does not correctly handle "\t" in format string
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 bug report at: http://bugs.php.net/?id=12337&edit=1