Using XML node names with hyphens in PHP

krohn7master

New Member
I am trying to extract some data from XML but when I execute the following I get a "Warning: Invalid argument supplied for foreach() in ..." message\[code\]foreach ($xml->custom-field-value as $milestone) { print "<tr>"; print "<td>".$milestone->{'field-number'}." ".$milestone->{'value'}."</td>"; print "</tr>";}\[/code\]It works fine for node names that are single words so I am guessing that it doesn't like the hyphens. Do I need to escape them and if so how?
 
Back
Top