Paste value in Array chunk

0

I have 12 teams registered in a table and I want to divide them into 3 groups. So I get these teams in array form and I use array_chunk to split them, which will form the 3 groups of 4 teams I want.

But I am not able to access NAME_TEAM , I have tried several ways and I can not. Could someone help me?

See how the array is mounted.

Array
(
    [0] => Array
        (
            [0] => stdClass Object
                (
                    [id_t] => 222
                    [name_team] => Atletico GO
                    [name_coach] => Afonso de Carvalo
                    [active_team] => 1
                )

            [1] => stdClass Object
                (
                    [id_t] => 223
                    [name_team] => Atletico MG
                    [name_coach] => Levir culpi
                    [active_team] => 1
                )

            [2] => stdClass Object
                (
                    [id_t] => 224
                    [name_team] => Palmeiras
                    [name_coach] => Cuca
                    [active_team] => 1
                )

            [3] => stdClass Object
                (
                    [id_t] => 225
                    [name_team] => Flamengo
                    [name_coach] => Zé Ricardo
                    [active_team] => 1
                )

        )

    [1] => Array
        (
            [0] => stdClass Object
                (
                    [id_t] => 226
                    [name_team] => Corinthians
                    [name_coach] => José da Silva
                    [active_team] => 1
                )

            [1] => stdClass Object
                (
                    [id_t] => 227
                    [name_team] => Santos
                    [name_coach] => Dorival Junior
                    [active_team] => 1
                )

            [2] => stdClass Object
                (
                    [id_t] => 228
                    [name_team] => Grêmio
                    [name_coach] => Renato Portallupi
                    [active_team] => 1
                )

            [3] => stdClass Object
                (
                    [id_t] => 229
                    [name_team] => Ponte Preta
                    [name_coach] => Ernando
                    [active_team] => 1
                )

        )

    [2] => Array
        (
            [0] => stdClass Object
                (
                    [id_t] => 242
                    [name_team] => Vasco
                    [name_coach] => Milton Santos
                    [active_team] => 1
                )

            [1] => stdClass Object
                (
                    [id_t] => 245
                    [name_team] => Botafogo
                    [name_coach] => Jair Ventura
                    [active_team] => 1
                )

            [2] => stdClass Object
                (
                    [id_t] => 246
                    [name_team] => São Paulo
                    [name_coach] => Rogério Ceni
                    [active_team] => 1
                )

            [3] => stdClass Object
                (
                    [id_t] => 247
                    [name_team] => Cruzeiro
                    [name_coach] => Mano Menezes
                    [active_team] => 1
                )

        )

)
    
asked by anonymous 25.08.2017 / 17:36

1 answer

0

Try:

$obj = $teuArray[0][0];

$nomeTime = $obj->name_team;
    
25.08.2017 / 17:43