<?php
file =fopen("/PhpProject/sample.txt","r");// print current positionechoftell(file);// change current positionfseek(file,"10");// print current position againecho"\n".ftell(file);fclose($file);?>
PHP
输出
010
PHP
示例2
<?php// opens a file and read data
file =fopen("/PhpProject/sample.txt","r");data =fgets(file,7);echoftell(file);fclose($file);?>