I guess I'll never know how and why they were created in such an unusable format.
You first task is to correct that shortcoming and restructure the two arrays. I suggest
$alpha1 = [
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.12.15.161, Type=OctetString, Value= D8 B0 53 C4 01 E5",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.15.65.47, Type=OctetString, Value= 5C D0 6E F0 F9 2E",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.52, Type=OctetString, Value= 84 B1 E4 6E 93 4F",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.53, Type=OctetString, Value= 1C 6A 76 41 09 B9",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.59, Type=OctetString, Value= 84 B1 E4 70 C7 D9",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.60, Type=OctetString, Value= 6C 7E 67 41 27 C3",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.67, Type=OctetString, Value= CE B9 5E 32 17 61"
];
$alpha2 = [
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.12.15.161, Type=OctetString, Value=GA871",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.15.65.47, Type=OctetString, Value=MC990",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.52, Type=OctetString, Value=svc_rover@gstt.local",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.53, Type=OctetString, Value=svc_rover@gstt.local",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.59, Type=OctetString, Value=svc_rover@gstt.local",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.60, Type=OctetString, Value=svc_rover@gstt.local",
"OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.67, Type=OctetString, Value=svc_rover@gstt.local"
];
$alpha1 = array_map('convert', $alpha1); // apply the calback function convert() to each element
$alpha2 = array_map('convert', $alpha2);
function convert($str) // callback function
{
$a = explode(', ', $str);
$res = [];
foreach ($a as $str2) {
$b = explode('=', $str2);
if ($b[0] == 'OID') {
// we only want the last 4 elements
$res[$b[0]] = join('.', array_slice(explode('.', $b[1]), -4));
}
else $res[$b[0]] = $b[1];
}
return $res ;
}
You now have two arrays in this format, which are much more easily processed...
$arr = array (
0 => array (
'OID' => '10.12.15.161',
'Type' => 'OctetString',
'Value' => ' D8 B0 53 C4 01 E5',
),
1 => array (
'OID' => '10.15.65.47',
'Type' => 'OctetString',
'Value' => ' 5C D0 6E F0 F9 2E',
),
2 => array (
'OID' => '10.36.240.52',
'Type' => 'OctetString',
'Value' => ' 84 B1 E4 6E 93 4F',
),
3 => array (
'OID' => '10.36.240.53',
'Type' => 'OctetString',
'Value' => ' 1C 6A 76 41 09 B9',
),
4 => array (
'OID' => '10.36.240.59',
'Type' => 'OctetString',
'Value' => ' 84 B1 E4 70 C7 D9',
),
5 => array (
'OID' => '10.36.240.60',
'Type' => 'OctetString',
'Value' => ' 6C 7E 67 41 27 C3',
),
6 => array (
'OID' => '10.36.240.67',
'Type' => 'OctetString',
'Value' => ' CE B9 5E 32 17 61',
),
);
That's the hard part done. Now it's just a matter of looping through one array and looking for matches in the other.