PHP 7 rewind() Function
❮ PHP Filesystem ReferenceExample
Rewind the position of the file pointer to the beginning of the file:
<?php
$file = fopen("test.txt","r");
//Change position of file pointer
fseek($file,"15");
//Set file pointer to 0
rewind($file);
fclose($file);
?> 
Definition and Usage
The rewind() function "rewinds" the position of the file pointer to the beginning of the file.
Syntax
rewind(file)
| Parameter | Description | 
|---|---|
| file | Required. Specifies the open file | 
Technical Details
| Return Value: | TRUE on success, FALSE on failure | 
|---|---|
| PHP Version: | 4.0+ | 
❮ PHP Filesystem Reference

