Current Location: Home> Function Categories> sscanf

sscanf

Parses entered characters according to the specified format
Name:sscanf
Category:String
Programming Language:php
One-line Description:Parses input from the string according to the specified format.

Definition and usage

sscanf() function parses input from the string based on the specified format. sscanf() function parses strings into variables based on format strings.

If only two parameters are passed to the function, the data will be returned as an array. Otherwise, if additional parameters are passed, the parsed data will be stored in these parameters. An error occurs if the number of differentiators is greater than the number of variables containing them. However, if the number of differentiators is less than the number of variables containing them, the additional variables contain NULL.

Related functions:

  • printf() - output formatted string
  • sprintf() - Write a formatted string into a variable
Similar Functions
Popular Articles