Home > Article > Backend Development > How to use rewind function
php rewind() function rewinds the position of the file pointer.
php rewind() function Syntax
Function: Rewind the position of the file pointer to the beginning of the file.
Syntax:
rewind(file)
Parameters:
file Required. Specifies an open file.
Description: If successful, return true. On failure, returns false.
php rewind() function example
<?php $file = fopen("./test.txt","r"); //改变文件指针的位置 fseek($file,"13"); //把文件指针设定为 0 rewind($file); //输出指针位置 echo ftell($file); ?>
This article is an introduction to the PHP rewind function. I hope it will be helpful to friends in need!
The above is the detailed content of How to use rewind function. For more information, please follow other related articles on the PHP Chinese website!