Reset the file pointer position to the start 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); ?> |
The rewind() function resets the file pointer to the beginning of the file.
rewind(file) |
Parameter |
Description |
file |
Required. Specifies the open file or stream. |
Return Value: |
Returns TRUE on success, FALSE on failure. |
PHP Version: |
4.0+ |