Currently I have two arrays as shown in the picture below. What is the best way to compare them? Either by combining them together and compare within one array or compare the way I did?
$array1
$array2
This is what i did to compare them
<table>
<thead><tr><td>status</td></tr></thead>
<tbody>
<tr>
<td>
foreach($array1 as $key => $value)
{
foreach($array2 as $ke2 => $value2)
{
if($value[0] == $value2[0] &&
$value[1] == $value2[1] &&
$value[2] == $value2[2])
YES
else
NO
}
}
</td>
<tr>
</tbody>
</table>
updated
<table>
<thead><tr><td>status</td></tr></thead>
<tbody>
<tr>
<td>
@foreach ($array1 as $key => $value)
@if (isset($array2[$key]) && $value == $array2[$key])
Yes
@else
No
@endif
@endforeach
</td>
<tr>
</tbody>
</table>
but this display in the table like this
Status
NoYesYes
NoYesYes
NoYesYes
Suppose to be
Status
No
Yes
Yes