I have some json object that I decoded, and one of the attributes starts with an \"@\" and I can\'t access the element with php because it throws an error.
Try to use,
$objSimpleXml->attributes()->id
Sample Code to Refer
1 XML; $xml = simplexml_load_string($string); var_dump( $xml ); foreach($xml->foo[0]->attributes() as $a => $b) { echo $a,'="',$b,"\"\n"; } ?>