[UPHPU] Accessing object elements with punctuation marks

Richard K Miller richardkmiller at gmail.com
Thu Mar 29 11:12:36 MDT 2007


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.

	print_r($xml->GetDomains);

Output:
	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?

Richard





More information about the UPHPU mailing list