PHP rewind() 函數(shù)
定義和用法
rewind() 函數(shù)將文件指針的位置倒回文件的開頭。
若成功,則返回 true。若失敗,則返回 false。
語法
rewind(file)
| 參數(shù) | 描述 |
|---|---|
| file | 必需。規(guī)定已打開的文件。 |
例子
<?php
$file = fopen("test.txt","r");
//改變文件指針的位置
fseek($file,"15");
//把文件指針設(shè)定為 0
rewind($file);
fclose($file);
?>