First of all - thx for ansvers.
I have got 2 arrays:
For example:
['a' => abc, 'b' => cde]
And second one
['fcb' => cde, 'avm' => efg]
Need to have true of 'b' and 'cde'.
How get a certain similarity for this?
First of all - thx for ansvers.
I have got 2 arrays:
For example:
['a' => abc, 'b' => cde]
And second one
['fcb' => cde, 'avm' => efg]
Need to have true of 'b' and 'cde'.
How get a certain similarity for this?
I may be falling into a trap; but, you can compute the intersection (common values) and loop them and search for the key:
$result = array_intersect($array1, $array2);
foreach($result as $val) {
echo "$val found in array1 at key: " . array_search($val, $array1)."<br>
";
echo "$val found in array2 at key: " . array_search($val, $array2)."<br>
";
}
See Example.