This is a discussion on "[SOLVED] Reading as text file backwards" within the PHP Forum section. This forum, and the thread "[SOLVED] Reading as text file backwards are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Reading as text file backwards
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Reading as text file backwards
Hi everyone.
Im currently reading server log files from my server and taking the data into arrays. To make sure im getting the most relevant data im doing a time check to only get the latest hours data. The only problem?? The file is HUGE, and the code scans the whole file before pulling the relevant data. Which is annoying considering the most recent data is at the bottom of the file! So does anyone know of a way to read the file line by line but backwards?? Thanks again. Eon201 |
|
|
|
||||
|
Re: Reading as text file backwards
$this_array = array_reverse($this_array);
That will reverse the array...
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: Reading as text file backwards
ok thanks (again!) Rakuli.
So therefore I should take my code:
|
|
||||
|
Re: Reading as text file backwards
Not quite
You have it in the wrong order..
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] fread only reading 78 characters | CloudedVision | PHP Forum | 2 | Apr 7th, 2008 20:50 |
| [SOLVED] Reading a remote XML source in JavaScript | jonbritton | JavaScript Forum | 2 | Jan 25th, 2008 13:01 |
| reading a log file one line at a time depending on timestamp | eon201 | PHP Forum | 1 | Dec 4th, 2007 05:54 |
| [SOLVED] Reading output. | alexgeek | PHP Forum | 2 | Oct 30th, 2007 00:41 |
| Syntax error with Ajax file reading | Paramiliar | JavaScript Forum | 0 | Aug 12th, 2007 16:48 |