I am making an API call using PHP CURL to a specific URL. I am able to receive response in my browser.
CURL is saving this response in a Variable like this:
$output = curl_exec($ch);
Now when I use
I get this response in my browser.
<?xml version="1.0" encoding="utf-16" standalone="no"?> <loginres> <sessiontoken>123456</sessiontoken> <timeout>7/30/2016 11:18:22 AM</timeout> <status>1</status> </loginres>
Since, this is a UTF-16 encoded response, I am not able to use SimpleXML or DOM document. You can try this out(I have failed several times). Nothing is coming.
Also, I have tried, to use "explode" function with Array filter, and the response looks like this:
Array (  => version="1.0"  => encoding="utf-16"  => standalone="no"?>  => 123456  => 7/30/2016  => 11:26:09  => AM  => 1 )
Now, my question is , how do I use this file.... I wanted to create PHP variables out of XML tags, and parse them, to manipulate and save in my database.
The other option is to save the response in an xml file, in my local server, and use it using Jquery, Ajax, but I don't know how to do it. Please help.