On Tuesday 14 May 2002 19:42, Josh Edwards wrote:
> Here is a sample of my weblog that reads into an array from a file ie
>
> $filename = ("combined_log");
> $fcontents = file($filename);
>
> 203.29.154.13 - - [08/May/2002:21:21:07 +1000] "GET /A1.php HTTP/1.1" 200
> 417 "-
> " "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"

To help you get started this regex will match your input lines:

/^(.+)\s(.+)\s(.+)\s\[(.+)\]\s"(.+)"\s(\d+)\s(.+)\s"(.+)"\s"(.+)"/

breaking them into its components:

ip
identd
user
time
request
result
size
referrer

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Gomme's Laws:
        (1) A backscratcher will always find new itches.
        (2) Time accelerates.
        (3) The weather at home improves as soon as you go away.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to