PHP Object variable help

Status
Not open for further replies.
Hi Guys,
I have a simplexml object called $customer that when I do a print_r($customer), I get the following dump

SimpleXMLElement Object
(
[account-number] => 23423

[balance] = > 4.12

}

When I try doing "echo $customer->account-number", nothing is returned. But if I do "echo $customer->balance", the balance is echoed.

I think this has to do with the fact that there is a "-" between account and number. Does anyone know the work around for this problem?

I've tried

$customer['account-number'], $customer->"account-number", and every other possible combination I could think of.

Thanks for any help.
 
Status
Not open for further replies.