0
I’m integrating with an email marketing system. Data returns are coming in standard:
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 presented in groups of 2 with the same structure.
I am not able to access the data presented. I need to access the name for example. I tried several ways as $dados[0]['nome']
and I can’t access data values.
I need to put this data into one <select>
.
try it like this:
$dados[0]->nome
– Daniel Omine
@Danielomine Thanks! I had tried as object also before, but does not return/print anything.
– lelopes
@lelopes put the information before you arrive in this array!
– novic
@Danielomine. the answer to the request made for API is the code above in the question. I gave a var_dump and presented the answer.
– lelopes
this presented is probably the result of a
var_dump()
. It is used for testing only. Remove thevar_dump()
and treat API return normally.– Daniel Omine