What is fseek in PHP Filesystem

In this article I will go to explain about fseek function in PHP.
  • 1274

PHP fseek() Function

The filesystem fseek function seeks in an open file. This function is used to move the file pointer from its current position to a new position. This function works both forward and backward direction in a file.

Syntax of fseek function

fseek(file, offset, whence)

Parameters in fseek function

It have three parameter:

Parameter Description
file It specifies the open file to seek in.
offset It specifies the new position.
whence It contains many value like SEEK_SET, SEEK_CUR, SEEK_END.

Example of filesystem fseek function

<html>

<body>
 

<?php

$file = fopen("C:\wamp\www\Dinesh\Mcn.txt","r");

fgets($file);

fseek($file, 4);

?>
 

</body>

</html>


You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.