This doesn't work:
list($value) = sscanf('foo.bar','%s.bar');
echo $value; //foo.bar
While this does:
list($value开发者_如何转开发) = sscanf('foo bar','%s bar');
echo $value; //foo
Any suggestions are really appreciated. Thanks.
You can use a basic (negated) character class instead of s as in:
list($value) = sscanf('foo.bar','%[^.].bar');
echo $value; //foo
you can use explode instead of sscanf() for what you want to do.
$str = "foo.bar";
list($value1,$value2) = explode(".",$str);
print $value1;
I think it by design. It is trivial to use preg_match here, to be honest.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论