Elective Course

Course Recommendation:

PHP ftell() Function

Definition and Usage

ftell() function in the current position of the file opened

The function returns the current position of the file pointer. If it fails, it returns false.file pointerSyntax
) Parameter
file pointer Description

Required. Specifies the opened file to be checked.

Description file pointer file must be valid and must point to a file opened by fopen() or popen()

Successfully opened file.

In append mode (open file with parameter "a") ftell() will return an undefined error.

Example
<?php
$file = fopen("test.txt","r");
echo ftell($file);
// Output the current position
// Change the current position
// Again output the current position
echo ftell($file);
fclose($file);
?>

Output:

0
15