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