Current Location: Home> Function Categories> rewind

rewind

Rewind the file pointer position
Name:rewind
Category:File system
Programming Language:php
One-line Description:Rewind the file pointer position.

Definition and usage

The rewind() function rewinds the position of the file pointer back to the beginning of the file.

If successful, return true. If it fails, return false.

Example

 <?php
$file = fopen ( "test.txt" , "r" ) ;

//Change the file pointer position
fseek ( $file , "15" ) ;

//Set the file pointer to 0
rewind ( $file ) ;

fclose ( $file ) ;
?>

grammar

 rewind ( file )
parameter describe
file Required. Specifies the opened files.
Similar Functions
  • Determine whether the file exists and is readable is_readable

    is_readable

    Determinewhetherthef
  • Change file owner chown

    chown

    Changefileowner
  • Return to the directory part in the path dirname

    dirname

    Returntothedirectory
  • Determine whether the given file name is a normal file is_file

    is_file

    Determinewhethertheg
  • Read a line from a file pointer fgets

    fgets

    Readalinefromafilepo
  • Delete files unlink

    unlink

    Deletefiles
  • Format input from a file fscanf

    fscanf

    Formatinputfromafile
  • Open a file or URL fopen

    fopen

    OpenafileorURL
Popular Articles