¡@

Home 

php Programming Glossary: seek_end

Read last line from file

http://stackoverflow.com/questions/1510141/read-last-line-from-file

line '' f fopen 'data.txt' 'r' cursor 1 fseek f cursor SEEK_END char fgetc f Trim trailing newline chars of the file while char.. chars of the file while char n char r fseek f cursor SEEK_END char fgetc f Read until the start of file or first newline char..

Tailing Log File and Write results to new file

http://stackoverflow.com/questions/16892270/tailing-log-file-and-write-results-to-new-file

@ _SESSION 'ftell' ftell handle else fseek handle 1024 SEEK_END fclose handle @ _SESSION 'ftell' ftell handle This seems to.. fh fopen path 'r' go to the end of the file fseek fh 0 SEEK_END do need to know whether we can actually go back block_size bytes.. Seach for End of line while c n c PHP_EOL if fseek fp pos SEEK_END 1 break true break if ftell fp this lock getPosition break..

Read a file backwards line by line using fseek

http://stackoverflow.com/questions/3234580/read-a-file-backwards-line-by-line-using-fseek

fopen some_file.txt r for x_pos 0 output '' fseek fl x_pos SEEK_END 1 x_pos output . fgetc fl fclose fl print_r output Of course.. r for x_pos 0 ln 0 output array fseek fl x_pos SEEK_END 1 x_pos char fgetc fl if char n analyse completed line output..

calculate flv video file length ? using pure php

http://stackoverflow.com/questions/3282273/calculate-flv-video-file-length-using-pure-php

is some sample code flv fopen flvfile.flv rb fseek flv 4 SEEK_END arr unpack 'N' fread flv 4 last_tag_offset arr 1 fseek flv last_tag_offset.. flv 4 last_tag_offset arr 1 fseek flv last_tag_offset 4 SEEK_END fseek flv 4 SEEK_CUR t0 fread flv 3 t1 fread flv 1 arr unpack..

PHP x86 How to get filesize of >2GB file without external program?

http://stackoverflow.com/questions/5501451/php-x86-how-to-get-filesize-of-2gb-file-without-external-program

I know how to get it on 64bit platforms using fseek fp 0 SEEK_END and ftell but I need solution for 32bit platform. In other words..

How to insert some text in middle of file in PHP [closed]

http://stackoverflow.com/questions/6472408/how-to-insert-some-text-in-middle-of-file-in-php

handler file fopen filename r Seek to the end fseek file SEEK_END 0 Get and save that position filesize ftell file Seek to half..