diff --git a/reference/filesystem/functions/fscanf.xml b/reference/filesystem/functions/fscanf.xml index d32b2a7275ad..9282b702c085 100644 --- a/reference/filesystem/functions/fscanf.xml +++ b/reference/filesystem/functions/fscanf.xml @@ -14,66 +14,68 @@ stringformat mixedvars - + The function fscanf is similar to sscanf, but it takes its input from a file associated with stream and interprets the input according to the specified format. - - + + Any whitespace in the format string matches any whitespace in the input stream. This means that even a tab (\t) in the format string can match a single space character in the input stream. - - + + Each call to fscanf reads one line from the file. - + &reftitle.parameters; - - - - stream - - &fs.file.pointer; - - - &strings.scanf.parameter.format; - - vars - - - The optional assigned values. - - - - - + + + stream + + &fs.file.pointer; + + + &strings.scanf.parameter.format; + + vars + + + The optional assigned values. + + + + &reftitle.returnvalues; - + 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 + 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. - - + + If there are more substrings expected in the format than there are available within string, &null; will be returned. On other errors, &false; will be returned. - + + + When optional parameters are used and the end of the input read from + stream is reached before any value has been + parsed, -1 is returned. + &reftitle.examples; - - - <function>fscanf</function> Example - + + <function>fscanf</function> Example + ]]> - - - - - - Contents of users.txt - + + + + Contents of users.txt + - - - + + &reftitle.seealso; - - - fread - fgets - fgetss - sscanf - printf - sprintf - - + + fread + fgets + fgetss + sscanf + printf + sprintf + diff --git a/reference/spl/splfileobject/fscanf.xml b/reference/spl/splfileobject/fscanf.xml index d492b5ce969d..18e2e94a71b1 100644 --- a/reference/spl/splfileobject/fscanf.xml +++ b/reference/spl/splfileobject/fscanf.xml @@ -13,81 +13,85 @@ stringformat mixedvars - + Reads a line from the file and interprets it according to the specified format. - - + + Any whitespace in the format string matches any whitespace in the line from the file. This means that even a tab (\t) in the format string can match a single space character in the input stream. - + &reftitle.parameters; - - - &strings.scanf.parameter.format; - - vars - - - The optional assigned values. - - - - - + + &strings.scanf.parameter.format; + + vars + + + The optional assigned values. + + + + &reftitle.returnvalues; - + If only one parameter is passed to this method, 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 + returned as an array. Otherwise, if optional parameters are passed, + the method will return the number of assigned values. The optional parameters must be passed by reference. - + + + If there are more substrings expected in the format + than there are available in the line read from the file, + &null; will be returned. + + + When optional parameters are used and the end of the line read from the + file is reached before any value has been parsed, -1 + is returned. + &reftitle.examples; - - - <methodname>SplFileObject::fscanf</methodname> example - + + <methodname>SplFileObject::fscanf</methodname> example + fscanf("%s %s %s")) { - list ($name, $profession, $countrycode) = $userinfo; - // Do something with $name $profession $countrycode + list ($name, $profession, $countrycode) = $userinfo; + // Do something with $name $profession $countrycode } ?> ]]> - - Contents of users.txt - + + Contents of users.txt + - - - + + &reftitle.seealso; - - - fscanf - sscanf - printf - sprintf - - + + fscanf + sscanf + printf + sprintf + diff --git a/reference/strings/functions/sscanf.xml b/reference/strings/functions/sscanf.xml index 40977dca7b97..7e3c10ce3ae7 100644 --- a/reference/strings/functions/sscanf.xml +++ b/reference/strings/functions/sscanf.xml @@ -14,65 +14,67 @@ stringformat mixedvars - + The function sscanf is the input analog of printf. sscanf reads from the string string and interprets it according to the specified format. - - + + Any whitespace in the format string matches any whitespace in the input string. This means that even a tab (\t) in the format string can match a single space character in the input string. - + &reftitle.parameters; - - - - string - - - The input string being parsed. - - - - &strings.scanf.parameter.format; - - vars - - - Optionally pass in variables by reference that will contain the parsed values. - - - - - + + + string + + + The input string being parsed. + + + + &strings.scanf.parameter.format; + + vars + + + Optionally pass in variables by reference that will contain the parsed values. + + + + &reftitle.returnvalues; - + 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 + 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. - - + + If there are more substrings expected in the format than there are available within string, &null; will be returned. - + + + When optional parameters are used and the end of the input + string is reached before any value has been + parsed, -1 is returned. + &reftitle.examples; - - - <function>sscanf</function> Example - + + <function>sscanf</function> Example + ]]> - - - - + + + If optional parameters are passed, the function will return the number of assigned values. - - - - <function>sscanf</function> - using optional parameters - + + + <function>sscanf</function> - using optional parameters + \n"; ?> ]]> - - - + + &reftitle.seealso; - - - printf - sprintf - fprintf - vprintf - vsprintf - vfprintf - fscanf - number_format - date - - + + printf + sprintf + fprintf + vprintf + vsprintf + vfprintf + fscanf + number_format + date +