I have two array:
$one = Array
(
[0] => stdClass Object
(
[id] => 2
[name] => Southampton
)
[1] => stdClass Object
(
[id] => 4
[name] => Manchester United F.C
)
)
and
$two = Array
(
[0] => stdClass Object
(
[number] => 25555
[slice_1] => 4
[slice_2] => 4
[slice_3] => 2
[slice_4] => 4
[status] => Published
)
)
I want to output, if array $two->slice_1
same as array $one->id
than output $one->name
.
For example:
$two[0]->slice_1
(4) compare to $one[0]->id
(4) will result in Manchester United F.C.
Because the array $one
and $two
will be have more than one array. Please don't answer this:
if($two[0]->slice_1 == $one[1]->id){echo $one[0]->name;}
I'm stucking here and can't think out some way. Please help. Thanks in advance