[PHP] Help with file read

2002-05-19 Thread Josh Edwards
Can someone look and help I have a function that returns the date in this format [10/Apr/2002:01:17:27 +1000] but I'm having trouble returning the last date in the file. $totalhits = count($fcontents); $filename = (combined_log); //open file $fcontents = file($filename); //read into array

[PHP] date functions

2002-05-18 Thread Josh Edwards
Does anyone know a good way to count the days between two dates. ie how many Mondays fall between two dates. As a starting point I have calculated the start and end dates and the no of days b/w them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] array question

2002-05-17 Thread Josh Edwards
I have an array which I use a loop to add numbers to different elements in the array. I can extract the highest no which in this case is 48. ie ([22 ] = 48 [23 ] = 2 [12 ] = 22 [14 ] = 5 ) Using this highest no (48 in this instance), how do I get the position or [element No] that matches the

[PHP] Array problems again

2002-05-17 Thread Josh Edwards
Here's a sample of a weblog. I have a loop that extracts the request ie Get /A1.php How do I get the top ten requests and how many time these were requested after looping thru the whole file. Can you set up an array that is self populating if a string doesn't match an element in the array or is

[PHP] mktime()

2002-05-17 Thread Josh Edwards
After reading the manual Istill can't convert this 09/May/2002 to a timestamp. Any Pointers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] help with arrays

2002-05-16 Thread Josh Edwards
This is a basic question but I'm a basic fellow. If I have an array $timespread = array(12am-01am=0); $timespread[01am-02am]=0; $timespread[02am-03am]=0; etc Using $time which is a number, I want to add 1 to the value of $timespread[$time] without changing the key so if $time =1 I want to have

Re: [PHP] Newbie challenge to brainiacs

2002-05-15 Thread Josh Edwards
The challenge is to do it without SQL. Which blog do you recommend? David Jackson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Jay Blanchard wrote: The burning issue that begs to be answered is, why reinvent the wheel? There is a least a dozen blogs on

[PHP] Newbie - Spot the error

2002-05-15 Thread Josh Edwards
if I have $time = 21 then $timespread =array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); if ($time = = 21) $timespread[22]=($timespread[22]+1); echo $timespread[22] ; I get 0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Newbie - Spot the error

2002-05-15 Thread Josh Edwards
If I // $time==21 the count goes up by 1 so it's not recognizing the 21. Any ideas Olav bringedal [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... --- Josh Edwards [EMAIL PROTECTED] wrote: if I have $time = 21 then $timespread

[PHP] Where's the error?

2002-05-13 Thread Josh Edwards
This is meant to grab a date out of a log file from the first line of the array but I'm getting a parse error on line 13. Any ideas? function getdate($hit) { $single = explode ( ,$hit); return $single[3].$single[4]; } $filename = (combined_log); fopen ($filename, r); $fcontents =

Re: [PHP] Where's the error?

2002-05-13 Thread Josh Edwards
Thanks heaps for your help I really appreciate it. I have made the changes you suggested but now I only get a blank screen. function getmydate($hit) { $single = explode ( ,$hit); return $single[3].$single[4]; } $filename = (combined_log); //fopen ($filename, r); $fcontents =

Re: [PHP] Where's the error?

2002-05-13 Thread Josh Edwards
Josh Lars Torben Wilson [EMAIL PROTECTED] wrote in message 1021345553.886.133.camel@ali">news:1021345553.886.133.camel@ali... On Mon, 2002-05-13 at 20:01, Josh Edwards wrote: Thanks heaps for your help I really appreciate it. I have made the changes you suggested but now I only get

Re: [PHP] Where's the error?

2002-05-13 Thread Josh Edwards
Fixed !!! It should be $line = $fcontents[$i]; not $line = $fcontents[i]; Would you know the syntax to get the the last date? ie $lastdate = getmydate($line[(count($line))]); echo $lastdate; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] log analysis

2002-05-10 Thread Josh Edwards
Hi there, I'm working on using php to analyse an access log on an apache server. If a user inputs a file path I want to be able to use PHP to determine if it's a log file. Is there a function that will reject if it's not a binary file. If it's a binary file how would I then compare it to

Re: [PHP] log analysis

2002-05-10 Thread Josh Edwards
are seperated by spaces. J Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Fri, 10 May 2002, Josh Edwards wrote: I'm working on using php to analyse an access log on an apache server. If a user inputs a file path I want to be able to