Json & Array from XML in 3 lines:
$xml = simplexml_load_string($xml_string);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
More Related Contents:
- Is there any way to convert json to xml in PHP?
- PHP convert XML to JSON group when there is one child
- extract distinct tag value from xml file using php
- How to get the first key of many duplicated json key? [duplicate]
- json_decode returns NULL after webservice call
- Cannot use object of type stdClass as array?
- PHP json_encode encoding numbers as strings
- REST API – why use PUT DELETE POST GET?
- PHP json_decode() returns NULL with valid JSON?
- Any way to return PHP `json_encode` with encode UTF-8 and not Unicode? [duplicate]
- Why is this PHP call to json_encode silently failing – inability to handle single quotes?
- JavaScript: How do I create JSONP?
- Send post request using Volley and receive in PHP
- How to check if string is a valid XML element name?
- Convert invalid json into valid json
- Best way to process large XML in PHP [duplicate]
- PHP’s json_encode does not escape all JSON control characters
- POST request with JSON body
- Parsing JSON array with PHP foreach
- How to skip invalid characters in XML file using PHP
- Send data from android to server via JSON
- How can I access an object property named as a variable in php?
- PHP – Delete XML Element
- SimpleXML SOAP response Namespace issues
- how to fetch all the row of the result in php mysql?
- Convert all node’s attributes into child nodes
- How to save changed SimpleXML object back to file?
- XPath query with PHP
- json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT
- Laravel collection converts array to object