im trying to parse a simple xml string which contain basic attributes\[code\]<hash><engine-type>I4 DI</engine-type><body-style>SAV 4D</body-style><year>2012</year></hash>\[/code\]the problem happened when i tried to print out those 2 attributes engine-type and body-style the xdebug gives error
\[code\]$result = simplexml_load_string($query);$enginetype = $result->engine-type;$bodystyle = $result->body-style ;echo $enginetype .'<br />'. $bodystyle ;\[/code\]those are the errors came from xdebug\[code\]Notice: Use of undefined constant type - assumed 'type'Notice: Use of undefined constant style - assumed 'style\[/code\]when i tried to save them to my database the value 0
other attributes just work fine
\[code\]$result = simplexml_load_string($query);$enginetype = $result->engine-type;$bodystyle = $result->body-style ;echo $enginetype .'<br />'. $bodystyle ;\[/code\]those are the errors came from xdebug\[code\]Notice: Use of undefined constant type - assumed 'type'Notice: Use of undefined constant style - assumed 'style\[/code\]when i tried to save them to my database the value 0
other attributes just work fine