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
Popular Articles