PHP ftell은 () 함수
정의 및 사용
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);
?>
$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
15
PHP 파일 시스템 참조 설명서를 완료