Current Location: Home> Function Categories> fscanf

fscanf

Format input from a file
Name:fscanf
Category:File system
Programming Language:php
One-line Description:Parse the input according to the specified format.

Definition and usage

The fscanf() function parses the input from the opened file according to the specified format.

grammar

 fscanf ( file , format , mixed )
parameter describe
file Required. Specify documents to be inspected.
format Required. Specified format.
mixed Optional.

illustrate

fscanf() function is similar to sscanf() , but it accepts input from the file associated with the file and interprets the input according to the specified format . If only two parameters are passed to this function, the parsed value will be returned as an array. Otherwise, if optional parameters are provided, this function returns the number of assigned values. Optional parameters must be passed with reference.

Similar Functions
  • Synchronize changes to files (including metadata) fsync

    fsync

    Synchronizechangesto
  • Read a line from a file pointer fgets

    fgets

    Readalinefromafilepo
  • Returns the file path information pathinfo

    pathinfo

    Returnsthefilepathin
  • Returns the total size of the file system or disk partition disk_total_space

    disk_total_space

    Returnsthetotalsizeo
  • Test whether the file pointer reaches the end of the file feof

    feof

    Testwhetherthefilepo
  • Write to files (safely used in binary files) fwrite

    fwrite

    Writetofiles(safelyu
  • Create a temporary file tmpfile

    tmpfile

    Createatemporaryfile
  • Synchronize data (but not metadata) to a file fdatasync

    fdatasync

    Synchronizedata(butn
Popular Articles