|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
39 + 7 = ?
Subscribe to this entry?

 [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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-02 17:31 UTC]
%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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC