sscanf()
sscanf - Parses input from a string according to a format
Syntax
mixed sscanf (
string $str,
string $format,
mixed &$...)
Arguments
- str - The input string being parsed.
- format - The interpreted format for str, which is described in the documentation for sprintf() with following differences: Function is not locale-aware. F, g, Gand bare not supported. Dstands for decimal number. istands for integer with base detection. nstands for number of characters processed so far.
- ... - Optionally pass in variables by reference that will contain the parsed values.
Description
The function sscanf() is the input analog of printf(). sscanf() reads from the string str and interprets it according to the specified format, which is described in the documentation for sprintf().
Version
PHP 4.0.1, 5
Return value
If only two parameters were passed to this function, the values parsed will be returned as an array. Otherwise, if optional parameters are passed, the function will return the number of assigned values. The optional parameters must be passed by reference.