title: Simplexml_load_file(): I/O warning : failed to load external entity &quot; &quot;
body: <p>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</p>
  
  <pre><code>Warning: simplexml_load_file(): I/O warning : failed to load external entity &amp;quot; &amp;quot; in D://....;
  </code></pre>
  
  <p>And this is my code :</p>
  
  <pre><code>$url = 'http://website.com?xml&amp;param1=1&amp;param2=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;
  </code></pre>
  
  <p>Thanks every helping</p>