-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I am not able to access attributes from json using below function
private function xml_to_arr($str){
$str = trim($str);
$xml = simplexml_load_string($str);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
return $array;
}
Here is XML response from namesilo
<namesilo> <request> <operation>checkRegisterAvailability</operation> <ip>55.555.55.55</ip> </request> <reply> <code>300</code> <detail>success</detail> <available> <domain price="9.99">namesilo.com</domain> <domain price="19.99">namesilo.org</domain> </available> <unavailable> <domain>namesilo.net</domain> </unavailable> <invalid> <domain>n#mesilo.com</domain> </invalid> </reply> </namesilo>
I want get price attribute from
<domain price="9.99">namesilo.com</domain>