PHP rewind() 函数

定义和用法

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

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

语法

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

例子

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

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

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

fclose($file);
?>
系统帮助 | 给我留言 | 收藏本站
Copyright © 2005-2008 www.cnn84.com All Rights Reserved Ver:2.0
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南