SplFileObject::ftell

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::ftellReturn current file position

说锟斤拷

public SplFileObject::ftell ( void ) : int

Returns the position of the file pointer which represents the current offset in the file stream.

锟斤拷锟斤拷

锟剿猴拷锟斤拷没锟叫诧拷锟斤拷锟斤拷

锟斤拷锟斤拷值

Returns the position of the file pointer as an integer, or FALSE on error.

锟斤拷锟斤拷

Example #1 SplFileObject::ftell() example

<?php
$file 
= new SplFileObject("/etc/passwd");

// Read first line
$data $file->fgets();

// Where are we?
echo $file->ftell();
?>

锟轿硷拷

  • ftell() - 锟斤拷锟斤拷锟侥硷拷指锟斤拷锟�/写锟斤拷位锟斤拷