I have an array in the following way:
Array
(
[0] => Array
(
[IP] => 172.30.224.232
[Equipo] => Space-saving
[CodPat] => 111
)
[1] => Array
(
[IP] => 172.26.35.108
[Equipo] => Desktop Case
[CodPat] => 11212
)
[2] => Array
(
[IP] => 172.30.224.247
[Equipo] => Space-saving
[CodPat] => 123123
)
[3] => Array
(
[IP] => 172.30.224.247
[Equipo] => Space-saving
[CodPat] => 2323232
)
I have a cycle to extract the data from the IPs
for ($i=1; $i <= 255; $i++){
$ip = "172.26.35.".$i;
foreach ($ips as $val) {
if ($val['IP']==$ip) {
$existe = true;
$equipo = $val['Equipo'];
$codPat = $val['CodPat'];
break;
}
}
}
What I do not know how to solve is that it identifies duplicate IPs ... and try with functions like array_count_values (), array_map (), in_array (), etc. but I still can not get it to work like this ...
Any suggestions? Thank you!