i need to access a simplexml object using a string. ie.
$x->a->b = 'obj';
$s = 'a->b';
echo $x->$s;
but it doesn't seem to work...
please help!
:)
You can do that like this, if my memory serves me:
echo $x->{$s};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With