PHP function ftell() with example


 

PHP function ftell() with example

In this PHP tutorial section, we will explain you how to learn about the PHP ftell() function and its example

In this PHP tutorial section, we will explain you how to learn about the PHP ftell() function and its example

Syntax

int ftell(file_handle)

  • ftell() function gives the current position of the file pointer.
  • using the file handler in bytes.

Example of PHP ftell() Function

Code
<?php

$file
=fopen("roseindia.txt","r");
echo
ftell($file);
fseek($file,40);
echo
"<br>".ftell($file);
?>

Output
0
40

Ads