Dec 27, 2007, 9:55 AM
Post #1 of 6
I have an array that contains comma separated strings. The strings represent parameters for a router access list. Second and fourth parameters are source and destination IP addresses. I am looking to create another array with a unique combination of source and destination IPs (combination of parameter 2 and 4 ).
Looking for duplicates
Here is what array looks like
$array = tcp,22.214.171.124,,,126.96.36.199,,123
$array = tcp,188.8.131.52,,,184.108.40.206,,456
$array = tcp,220.127.116.11,,123,18.104.22.168,,
$array = tcp,22.214.171.124,,1234,126.96.36.199,,
$array = tcp,188.8.131.52,,456,184.108.40.206,,
Please note that the lines do not have duplicates.
What is the best way to parse out the the uniqe combinations of 2 ip addresses?