i tried to some the ways load data xml from URL before ask this question but all same failed . Same have some special characters in XML url . this is error
Warning: simplexml_load_file(): I/O warning : failed to load external entity " " in D://....;
And this is my code :
$url = 'http://website.com?xml¶m1=1¶m2=2';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); // get the url contents
$data = curl_exec($ch); // execute curl request
curl_close($ch);
$xml = simplexml_load_string($data);
$json = json_encode($xml);
echo $json;
Thanks every helping