PHP rewind () function
Definition and Usage
rewind () function rewinds the file pointer location beginning of the file.
If successful, the function returns TRUE. If it fails, it returns FALSE.
grammar
rewind(file)
参数 | 描述 |
---|---|
file | 必需。规定已打开的文件。 |
Examples
<?php
$file = fopen("test.txt","r");
//Change position of file pointer
fseek($file,"15");
//Set file pointer to 0
rewind($file);
fclose($file);
?>
$file = fopen("test.txt","r");
//Change position of file pointer
fseek($file,"15");
//Set file pointer to 0
rewind($file);
fclose($file);
?>
Complete PHP Filesystem Reference Manual