1. 程式人生 > WINDOWS開發 >PHP rewind() 函式

PHP rewind() 函式

定義和用法

rewind() 函式將檔案指標的位置倒回檔案的開頭。

如果成功,該函式返回 TRUE。如果失敗,則返回 FALSE。

語法

rewind(file)

引數描述
file 必需。規定已開啟的檔案。


例項

<?php
$file = fopen("test.txt","r");

//Change position of file pointer
fseek($file,"15");

//Set file pointer to 0
rewind($file);高傭聯盟www.cgewang.com

fclose($file);
?>