當前位置: 首頁> 函數類別大全> 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

    獲取文件權限
  • 從文件指針中讀入一行並解析CSV 字段 fgetcsv

    fgetcsv

    從文件指針中讀入一行並解析CSV字段
  • disk_free_space 的別名 diskfreespace

    diskfreespace

    disk_free_space的別名
  • 檢查文件或目錄是否存在 file_exists

    file_exists

    檢查文件或目錄是否存在
  • 獲取文件的最後訪問時間 fileatime

    fileatime

    獲取文件的最後訪問時間
  • 解析配置字符串 parse_ini_string

    parse_ini_string

    解析配置字符串
  • 更改當前的umask umask

    umask

    更改當前的umask
  • 判斷文件是否存在且可讀 is_readable

    is_readable

    判斷文件是否存在且可讀
熱門文章