PHP função ftell ()
Definição e Uso
função ftell () retorna a posição atual no arquivo aberto.
Retorna a posição atual do ponteiro do arquivo, em caso de falha retorna FALSE.
gramática
ftell(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的已打开文件。 |
Exemplos
<?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);
?>
$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);
?>
O código acima exibirá:
0
15
15
Manual Completo PHP Sistema de Arquivos de Referência