次のような 2 つの配列があり、さらに多くの結果が得られます。
Array
(
[0] => Array
(
[comName] => John
[locID] => L152145
[locName] => Johns House
)
)
私がやりたいのは、結果を比較することですが、locName要素のみです...これまでに取り組んでいるコードは次のとおりです。
$searchcode = "a url to json results";
$simple = file_get_contents($searchcode);
$arr = json_decode($simple , true);
次に、各jsonファイルに対してこれを行います
$result = array_intersect($arr, $anotherarr);
理想的には、これは両方の配列から一致する locNames を返します
助けてくれてありがとう!