I am using SimpleXML to load a response from an API call. However, if the server returns an error, it only returns a single XML tag with the error message:
<err>ERROR MESSAGE HERE</err>
I'm currently using this code to parse the API response:
$parsedresponse = simplexml_load_string($response);
The $parsedresponse variable contains only the error message. However, I need a way to check if the <err> tag is present so I know if there was an error. I can't seem to figure out how to do this...
Thank you!
if (!empty($response->err))etc but that doesn't seem to do anything....