[UPHPU] Accessing object elements with punctuation marks
alvaro at epliant.com
Thu Mar 29 11:36:05 MDT 2007
Richard K Miller wrote:
> This is probably a simple question but I'm not seeing it.
> I'm using simplexml_load_string() to convert an XML file into an object.
> $xml = simplexml_load_string($file);
> I can access the first node.
> SimpleXMLElement Object
> [multirrp] => False
> [domain-list] => SimpleXMLElement Object
> But I can't access the next node down because it contains a hyphen:
> print_r($xml->GetDomains->domain-list); // produces error because
> of hyphen
> How do I get around this?
Wrap it in curly braces:
More information about the UPHPU