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 arra
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: http://www.php.ne
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
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
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
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 t
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
>
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
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 blo
I'm a PHP beginner and I am amazed at the help people give you in this
newsgroup. I'm trying to attempt something ambitious (for me anyway) and
I'm looking for help.
Here is a sample of my weblog that reads into an array from a file ie
$filename = ("combined_log");
$fcontents = file($file
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: http://www.php.net/unsub.
1:24 +1000] "GET /A1.html HTTP/1.1" 304 -
"-"
"Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"
Regards
Josh
"Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message
1021345553.886.133.camel@ali">news:1021345553.886.133.camel@ali...
> On
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 = file($file
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 = file
g 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.
> >
> >
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 whats
16 matches
Mail list logo