|
-
Apr 25th, 2007, 02:10 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Sorting array stuff
Say i had an array of IP addresses:
IP_array(0)="192.168.1.1"
IP_array(1)="192.168.1.1"
IP_array(2)="192.168.1.1"
IP_array(3)="192.168.1.2"
IP_array(4)="192.168.1.2"
IP_array(5)="192.168.1.1"
IP_array(6)="192.168.1.1"
IP_array(7)="192.168.1.3"
IP_array(8)="192.168.1.1"
How could i place these into a different array that each IP only shows up once:
Sorted_IP_array(0)="192.168.1.1"
Sorted_IP_array(1)="192.168.1.2"
Sorted_IP_array(2)="192.168.1.3"
and then in another array it says how many times each array showed up:
IP_Frequency_array(0)="6" 'Index links to 192.168.1.1 in the above array
IP_Frequency_array(1)="2"
IP_Frequency_array(2)="1"
I'm creating a program that gets Apache logs and analyzes them and i need to get all the different IP addresses and files & see how many times an IP accesses an indvidual file, how many times an IP address accessed any file, and how many times a file was accessed. I can do the rest once i get this bit done, but i can't get my head around it.
Thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|