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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With