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
  • Truncate the file to a given length ftruncate

    ftruncate

    Truncatethefiletoagi
  • Get the inode modification time of the file filectime

    filectime

    Gettheinodemodificat
  • Get file information through the opened file pointer fstat

    fstat

    Getfileinformationth
  • Format input from a file fscanf

    fscanf

    Formatinputfromafile
  • Open process file pointer popen

    popen

    Openprocessfilepoint
  • Change the current umask umask

    umask

    Changethecurrentumas
  • Read a line from a file pointer fgets

    fgets

    Readalinefromafilepo
  • Find file paths that match patterns glob

    glob

    Findfilepathsthatmat
Popular Articles