1
<?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>
上午使用simplexml_load_string並使用屬性函數來獲取代碼,並且我不斷得到空值。從xml文件獲取屬性php
$results = simplexml_load_string($response);
$errorCode = $results->attributes()->{'errors'};
謝謝效果很好 – mululu