php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13518 sscanf don't like the next character following the field definition.
Submitted: 2001-10-02 14:32 UTC Modified: 2001-10-02 17:31 UTC
From: bomek at egeolog dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.0.6 OS: Linux 2.4.9 (redhat 6.2)
Private report: No CVE-ID: None
 [2001-10-02 14:32 UTC] bomek at egeolog dot com
$string = "aaa:bbb:ccc:ddd";
list($a,$b,$c,$d) = sscanf($string,"%s:%s:%s:%s");
print "$a,$b,$c,$d\n";

$string will be contained in $a instead of being splitted in $a,$b,$c,$d.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-02 17:31 UTC] mfischer@php.net
%s Matches a sequence of non-white-space characters. This is taken straight from the sscanf manual page. Although PHP has its own implemention, at this point they do match.

If you have such simple things you might want to use explode(), split() and friends.

Not a bug, bogusified.

- Markus
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 09:01:25 2019 UTC