In this part of the tutorial we will learn about the function rewind in context of file handling. And also we will see the example related to the rewind function
In this part of the tutorial we will learn about the function rewind in context of file handling. And also we will see the example related to the rewind function
PHP rewind() Function Syntax
bool rewind(file_handle)
<?php
$file=fopen("roseindia.txt","r");
echo "<br>file
pointer position ".ftell($file);
fgets($file);
fgets($file);
echo "<br>file
pointer position ".ftell($file);
rewind($file);
echo "<br>after
rewind file pointer position ".ftell($file);
?>
Output