<?xml version="1.0" encoding="UTF-8"?>
<abc-response>
<error-messages>
<errors code="302">
User does not have access to this Product
</errors>
</error-messages>
</abc-response>
am using simplexml_load_string and using the attribute function to get the code and I keep getting a null value.
$results = simplexml_load_string($response);
$errorCode = $results->attributes()->{'errors'};