Returning Data from an API

0

I'm doing integration with an Email Marketing system. The data returns are coming in the pattern:

Array(
[0] => Criaenvio\Grupo Object
    (
        [nome] => Geral
        [ativo] => 1
        [contatos_ativos] => 0
        [id] => JCp
        [_tipoSolicitacao:protected] => 1
        [_caminho:protected] => 
        [_parametros:protected] => Array
            (
            )

        [_parametrosURL:protected] => Array
            (
            )

    )

[1] => Criaenvio\Grupo Object
    (
        [nome] => Lista Teste
        [ativo] => 1
        [contatos_ativos] => 0
        [id] => JCG
        [_tipoSolicitacao:protected] => 1
        [_caminho:protected] => 
        [_parametros:protected] => Array
            (
            )

        [_parametrosURL:protected] => Array
            (
            )
    )
)

The result is always displayed in groups of 2 with the same structure. I am unable to access the data presented. I need to access the name for example. I tried several shapes as $dados[0]['nome'] and I can not access the data values.

I need to put this data in <select> .

    
asked by anonymous 17.10.2016 / 18:49

1 answer

0

Try to do as @Daniel Omine suggested. $dados[0]->nome .

Apparently you have an array of objects and in PHP array you access this way: $var["chave"] and object you access like this: $obj->atributo .

    
17.10.2016 / 19:10