PHP rewind() 函数

PHP Filesystem 函数


定义和用法

rewind() 函数将文件指针的位置倒回文件的开头。

若成功,则返回 true。若失败,则返回 false。

语法

rewind(file)
参数 描述
file 必需。规定已打开的文件。

例子

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

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

//把文件指针设定为 0
 rewind($file);

fclose($file);
?>

PHP Filesystem 函数

本教程仅供参考学习,如用于商业带来的问题,本站概不负责。
关注公众号
关注公众号

©2020 IT自习室京ICP备20010815号