當前位置: 首頁> 函數類別大全> rewind

rewind

倒回文件指針的位置
名稱:rewind
分類:文件系統
所屬語言:php
一句話介紹:倒回文件指針的位置。

定義和用法

rewind()函數將文件指針的位置倒回文件的開頭。

若成功,則返回true。若失敗,則返回false。

實例

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

//改變文件指針的位置
fseek ( $file , "15" ) ;

//把文件指針設定為0
rewind ( $file ) ;

fclose ( $file ) ;
?>

文法

rewind ( file )
參數描述
file必需。規定已打開的文件。
同類函數
  • 獲取文件權限 fileperms

    fileperms

    獲取文件權限
  • disk_free_space 的別名 diskfreespace

    diskfreespace

    disk_free_space的別名
  • 倒回文件指針的位置 rewind

    rewind

    倒回文件指針的位置
  • 返回文件系統或磁盤分區的總大小 disk_total_space

    disk_total_space

    返回文件系統或磁盤分區的總大小
  • 將文件截斷到給定的長度 ftruncate

    ftruncate

    將文件截斷到給定的長度
  • 將整個文件讀入一個字符串 file_get_contents

    file_get_contents

    將整個文件讀入一個字符串
  • 返回規範化的絕對路徑名 realpath

    realpath

    返回規範化的絕對路徑名
  • 返回文件系統或磁盤分區上的可用空間 disk_free_space

    disk_free_space

    返回文件系統或磁盤分區上的可用空間
熱門文章