note 110947 deleted from book.simplexml by aharvey
| From: | aharvey@php.net | Date: | Tue, 08 Jan 2013 02:36:25 +0000 |
| Subject: | note 110947 deleted from book.simplexml by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192794@lists.php.net to get a copy of this message | ||
Note Submitter: sunnykachwala at yahoo dot com
----
$xml = simplexml_load_string($response);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
print_r($array);
[0] => Array
(
[@attributes] => Array
(
[uri] => https://localhost:1234/abc/cst/2/
[id] => 2
)
[name] => Array
(
[first] => abcd
[last] => efg
)
[company] => abc SOLUTION
[email] => abc@xyz.com
[homepage] => WWW.abcxyz.COM
[phone_numbers] => Array
(
[phone_number] => Array
(
[0] => Array
(
[main] => true
[type] => work
[list_order] => 1
[number] => +919876543210
)
[1] => Array
(
[main] => false
[type] => mobile
[list_order] => 2
[number] => +919876543210
)
)
)
[photo] => Array
(
[@attributes] => Array
(
[uri] => https://localhost:1234/abc/cst/2/cust_photo/
)
)
)
i used the above code to transfer data in array but i want all attribute and all node valued in one
single array