![]() |
The PHP sscanf() is an inbuilt function in PHP where the input string is parsed according to the specified or a particular pattern, along with comparing & matching any whitespace in between the format string & input string, which means, even the tab(\t) will be comparing & matches a single space character in between the format string & input string. Syntax: sscanf(string $input, string $format, mixed &...$vars): array|int|null Parameters: This function accepts three parameters that are described below.
Return Values: The sscanf() function returns an array when two parameters are passed. This function returns a parsed value in an array otherwise it will return the number of characters. If the error occurs, it will return “null”. Example 1: The following code demonstrates the sscanf() function. PHP
Output: Number 1: 10 Number 2: 20 Example 2: The following code demonstrates the sscanf() function. PHP
Output: First name: Amit Last name: Kumar Reference: https://www.php.net/manual/en/function.sscanf.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |