sscanf

mixed sscanf(string string, string format, [mixed $variables]) 
string String to parse
format Format to use
$variables One or more variables to store

Parses input from a string according to a specified format.

Returns:

Integer or array; FALSE on error

Description:

sscanf() parses string into variables based on the format string. The format string uses the same conversion specifiers as sprintf(); however, instead of formatting and transforming variables, it provides a template with which to parse a string into variables. See sprintf() for a complete list of conversion specifiers.

This function accepts two or more arguments. If only two arguments are provided, the data parsed from string is returned as a numerically keyed array. If ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.