I have Result
of a Webservice
below, I'm doing some foreachs to read each level of the class, but I think you should have a more elegant way of reading and getting the values of the object, follow Result
:
stdClass Object
(
[Codigo] => 1-0-21
[Descricao] => REGIONAL DDD21
[DddArray] => stdClass Object
(
[string] => 21
)
[Valores] => stdClass Object
(
[Valor] => Array
(
[0] => stdClass Object
(
[ValorFace] => 1000
[ValorBonus] => 0
[Produto] => RECARGA CELULAR
)
[1] => stdClass Object
(
[ValorFace] => 1500
[ValorBonus] => 0
[Produto] => RECARGA CELULAR
)
[2] => stdClass Object
(
[ValorFace] => 2000
[ValorBonus] => 0
[Produto] => RECARGA CELULAR
)
)
)
)
This text is the result of the function:
$res = $client->RetornaRegionaisPorOperadoraDdd($params);
The way I'm doing is very "POG":
foreach ($res as $key => $value){
foreach ($value as $keyopera => $valopera){
print_r($valopera);
}
}