Trying to count occurences of uknown array elements
Posted: Thu Jun 24, 2004 9:17 am
Hi
I'm writing a scrip to crunch through the Syslogs stored in an MS SQL database from various PIX's in my organisation.
For a particular part of the script I have retrieved all the data I need (FWIW source IP's of connection attempts), formatted and stripped extraneous stuff and got them sitting in an indexed array. Now I'm stuck.
What I am trying to do is run through the array and at each occurence of a new IP address do something with it (I won't know what the IP addresses are at this stage) which will let me count the number of times each IP address is found, then order the output by the most frequently occuring IP address. hmm....
I'm really stuck, new to php in general and this is my first attempt at doing something useful with it so any help appreciated.
I'm writing a scrip to crunch through the Syslogs stored in an MS SQL database from various PIX's in my organisation.
For a particular part of the script I have retrieved all the data I need (FWIW source IP's of connection attempts), formatted and stripped extraneous stuff and got them sitting in an indexed array. Now I'm stuck.
What I am trying to do is run through the array and at each occurence of a new IP address do something with it (I won't know what the IP addresses are at this stage) which will let me count the number of times each IP address is found, then order the output by the most frequently occuring IP address. hmm....
I'm really stuck, new to php in general and this is my first attempt at doing something useful with it so any help appreciated.