1
Good night.
I have an array of an object and would like to take two values:
object(OrgaosJurisdicionais)[17]
protected 'data' =>
array (size=3)
'id' => string '3' (length=1)
'nome' => string 'Tribunal de Justiça do Estado do Pernambuco' (length=44)
'sigla' => string 'TJPE' (length=4)
protected 'vdata' => null
protected 'attributes' =>
array (size=2)
0 => string 'nome' (length=4)
1 => string 'sigla' (length=5)
How do I only get the ID and NAME of this array?
I used the foreach below but did not return any value:
foreach ($unidades as $keys => $unidade)
{
echo $keys.' - '.$unidade->nome;
}
You need the data in
data
, which is a fieldprotected
. Do you have any public method in classOrgaosJurisdicionais
that allows you to access this value?– Woss