xml-json - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of xml-json.php
- <?php
- $response = '<xml version="1.0">
- <Response>
- <ResponseCode>00</ResponseCode>
- <ResponseDescription>Approved or Completed Successfully</ResponseDescription>
- <Items>1</Items>
- <Items>2</Items>
- <Items>3</Items>
- </Response>
- </xml>';
- $xml = simplexml_load_string(trim($response));
- $arr = json_decode(json_encode($xml), TRUE);
- $json = json_encode($arr, JSON_PRETTY_PRINT);
- echo $json;
File Description
- xml-json
- PHP Code
- 14 Dec-2018
- 396 Bytes
You can Share it:
Latest PHP Pastes