I have the following type of object :
[RateInfo] => stdClass Object
(
[@rateChange] => false
[@promo] => false
[@priceBreakdown] => true
)
When I am trying to print the array in php like :
echo $res->rateInfo->@rateChange;
It showing the syntax error in php and when I showing like without @
echo $res->rateInfo->rateChange;
It not showing the value. Whats wrong with this.
Thanks in advance.
Try
echo $res->rateInfo->{'@rateChange'};, note you need to quote it.