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,18.104.22.168,,,22.214.171.124,,123
$array = tcp,126.96.36.199,,,188.8.131.52,,456
$array = tcp,184.108.40.206,,123,220.127.116.11,,
$array = tcp,18.104.22.168,,1234,22.214.171.124,,
$array = tcp,126.96.36.199,,456,188.8.131.52,,
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?