How to use rewind function

藏色散人
Release: 2023-04-05 09:48:01
Original
5547 people have browsed it

php rewind() function rewinds the position of the file pointer.

How to use rewind function

php rewind() function Syntax

Function: Rewind the position of the file pointer to the beginning of the file.

Syntax:

rewind(file)
Copy after login

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);
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template