I have the follow arrays:
Array $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
)
)
)
)
And array $obreiros:
Array (
[0] => Array (
[Obreiro] => Array (
[id] => 2
[usuario_id] => 4
[nome] => Foo
)
)
[1] => Array (
[Obreiro] => Array (
[id] => 5
[usuario_id] => 8
[nome] => Bar
)
)
)
I want to do:
For each $obreiros which is a user, show if participated or not of the event (defined in array $evento[x]['Obreiro'][y], where x and y are numbers).
Sample:
| Event 1 | Event 2 | Event n
--------------------------------------
Foo | x | | x
Bar | x | x |
Foo 2 | | | x
How I can do this?
Have done the work with the code: