
SplFileObject::current 메소드는 파일의 현재 위치를 반환하지 않습니다. 대신, SplFileObject::ftell() 메소드를 사용하여 파일의 현재 위치를 확인할 수 있습니다.
#hostingforum.kr
php
$file = new SplFileObject('example.txt');
echo $file->ftell(); // 현재 위치를 출력합니다.
또한, SplFileObject::seek() 메소드를 사용하여 파일의 위치를 변경할 수 있습니다.
#hostingforum.kr
php
$file = new SplFileObject('example.txt');
$file->seek(10); // 10 번째 위치로 이동합니다.
echo $file->ftell(); // 10 번째 위치를 출력합니다.
2025-06-14 17:24