Voting

: four plus five?
(Example: nine)

The Note You're Voting On

narainsbrain at yahoo dot com
24 years ago
apparently, sscanf always splits at spaces, even if spaces are not specified in the format. consider this script:
<?php
$str = "This is a\tsentence with\ttabs";
$scanned = sscanf($str, "%s\t%s\t%s");
echo join(" : ", $scanned);
?>

this echoes "This : is : a", not the expected "This is a : sentence with : tabs."
this behaviour is fine if your strings don't contain spaces, but if they do you'd be better off using explode().

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /