note 110947 added to book.simplexml

From: Date: Fri, 28 Dec 2012 06:37:09 +0000
Subject: note 110947 added to book.simplexml
Groups: php.notes 
Request: Send a blank email to php-notes+get-192692@lists.php.net to get a copy of this message
$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 ---- Server IP: 69.147.83.199 Probable Submitter: 122.170.27.31 ---- Manual Page -- http://php.net/manual/en/book.simplexml.php Edit -- https://master.php.net/note/edit/110947 Del: integrated -- https://master.php.net/note/delete/110947/integrated Del: useless -- https://master.php.net/note/delete/110947/useless Del: bad code -- https://master.php.net/note/delete/110947/bad+code Del: spam -- https://master.php.net/note/delete/110947/spam Del: non-english -- https://master.php.net/note/delete/110947/non-english Del: in docs -- https://master.php.net/note/delete/110947/in+docs Del: other reasons-- https://master.php.net/note/delete/110947 Reject -- https://master.php.net/note/reject/110947 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#192692) next »