PHP 教程 PHP rewind() 函数

bradley · 2022-03-07 12:37:31 · 热度: 6

定义和用法

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);

fclose($file);
?>

查看更多 PHP Filesystem 函数

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册