次の配列があります。
配列$eventos
:
Array (
[0] => Array (
[Evento] => Array (
[id] => 1
[nome] => Event 1
)
[Obreiro] => Array (
[0] => Array (
[id] => 2
[usuario_id] => 4
[nome] => Teste
)
[1] => Array (
[id] => 5
[usuario_id] => 8
[nome] => Teste
)
)
)
[1] => Array (
[Evento] => Array (
[id] => 2
[nome] => Event 2
)
[Obreiro] => Array (
[0] => Array (
[id] => 3
[usuario_id] => 6
[nome] => Teste
)
[1] => Array
(
[id] => 5
[usuario_id] => 7
[nome] => Teste
)
)
)
)
そして配列$obreiros
:
Array (
[0] => Array (
[Obreiro] => Array (
[id] => 2
[usuario_id] => 4
[nome] => Foo
)
)
[1] => Array (
[Obreiro] => Array (
[id] => 5
[usuario_id] => 8
[nome] => Bar
)
)
)
やりたいこと:$obreiros
ユーザーであるそれぞれについて、イベントに参加したかどうかを表示します( array$evento[x]['Obreiro'][y]
で定義され、 x と y は数字です)。
サンプル:
| Event 1 | Event 2 | Event n
--------------------------------------
Foo | x | | x
Bar | x | x |
Foo 2 | | | x
どうすればこれを行うことができますか?