PHP ftell() 函数

PHP 教程 · 2019-01-25 08:59:23

定义和用法

ftell() 函数返回在打开文件中的当前位置。

返回文件指针的当前位置,如果失败则返回 FALSE。

语法


ftell(file)


参数 描述
file 必需。规定要检查的已打开文件。

实例


<?php
$file = fopen("test.txt","r");
// print current position
echo ftell($file);
// change current position
fseek($file,"15");
// print current position again
echo "<br />" . ftell($file);
fclose($file);
?>

上面的代码将输出:


0
15


点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Complexity and Approximation

Complexity and Approximation

G. Ausiello、P. Crescenzi、V. Kann、Marchetti-sp、Giorgio Gambosi、Alberto M. Spaccamela / Springer / 2003-02 / USD 74.95

This book is an up-to-date documentation of the state of the art in combinatorial optimization, presenting approximate solutions of virtually all relevant classes of NP-hard optimization problems. The......一起来看看 《Complexity and Approximation》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具