ftell

(PHP 4, PHP 5, PHP 7)

ftell锟斤拷锟斤拷锟侥硷拷指锟斤拷锟�/写锟斤拷位锟斤拷

说锟斤拷

ftell ( resource $handle ) : int

锟斤拷锟斤拷锟斤拷 handle 指锟斤拷锟斤拷锟侥硷拷指锟斤拷锟轿伙拷茫锟揭诧拷锟斤拷锟斤拷募锟斤拷锟斤拷械锟狡拷锟斤拷锟斤拷锟�

锟斤拷锟斤拷

handle

锟侥硷拷指锟斤拷锟斤拷锟斤拷锟斤拷锟叫э拷模锟斤拷冶锟斤拷锟街革拷锟揭伙拷锟酵拷锟� fopen() 锟斤拷 popen() 锟缴癸拷锟津开碉拷锟侥硷拷锟斤拷锟节革拷锟斤拷模式锟斤拷锟接诧拷锟斤拷 "a" 锟斤拷锟侥硷拷锟斤拷锟斤拷 ftell() 锟结返锟斤拷未锟斤拷锟斤拷锟斤拷锟�

锟斤拷锟斤拷值

Returns the position of the file pointer referenced by handle as an integer; i.e., its offset into the file stream.

锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� FALSE锟斤拷

锟斤拷锟斤拷

Example #1 ftell() 锟斤拷锟斤拷

<?php

// opens a file and read some data
$fp fopen("/etc/passwd""r");
$data fgets($fp12);

// where are we ?
echo ftell($fp); // 11

fclose($fp);

?>

锟轿硷拷

  • fopen() - 锟斤拷锟侥硷拷锟斤拷锟斤拷 URL
  • popen() - 锟津开斤拷锟斤拷锟侥硷拷指锟斤拷
  • fseek() - 锟斤拷锟侥硷拷指锟斤拷锟叫讹拷位
  • rewind() - 锟斤拷锟斤拷锟侥硷拷指锟斤拷锟轿伙拷锟�