Posted by Ben Holness on 10/03/89 11:51
> I know I could increase the memory settings in PHP - but is there a
> smarter way of counting entries in the log file without trying to load
> the entire thing into memory first?
You could read the file in line by line and count as you go using fopen()
and fread() or fgets() .. See the PHP pages for how to use them.
Alternatively you could make a system call with "grep 'GET /feed7.xml' | wc -l"
Ben
Navigation:
[Reply to this message]
|