title: file_get_contents() warning when load xml data
body: <p>what i want to do is : i have an CRM API which produce data in xml format,<br>
  i am using DOMDocument() to fetch the data into pieces. The problem is when i tried to load the data like : <code>$dom-&gt;loadXML($data);</code>   </p>
  
  <p>i got the error : </p>
  
  <p><code>DOMDocument::loadXML() [domdocument.loadxml]: Input is not proper UTF-8</code> </p>
  
  <p>i google i got an alternative solution to use with <code>file_get_contents()</code> but still i am getting warning like: </p>
  
  <p><img src="https://i.stack.imgur.com/cpBFt.png" alt="enter image description here"></p>
  
  <p>here is the code that i am using to fetch the xml data: </p>
  
  <pre><code>$text = file_get_contents(stripslashes(utf8_decode($data)));
  
  $doc = new DOMDocument();
  $doc-&gt;loadXML($text);
  </code></pre>
  
  <p>and here i put my XML return data, not complete but just a small piece: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;whmcsapi version="5.0.3"&gt;
  &lt;action&gt;getticket&lt;/action&gt;
  &lt;result&gt;success&lt;/result&gt;
  &lt;ticketid&gt;5767&lt;/ticketid&gt;
  &lt;tid&gt;409865&lt;/tid&gt;
  &lt;c&gt;NwLldOG6&lt;/c&gt;
  &lt;deptid&gt;2&lt;/deptid&gt;
  &lt;deptname&gt;Technical&lt;/deptname&gt;
  &lt;userid&gt;27476&lt;/userid&gt;
  &lt;name&gt;shirley b broyles (home)&lt;/name&gt;
  &lt;email&gt;sbroyles1@stx.rr.com&lt;/email&gt;
  &lt;cc&gt;&lt;/cc&gt;
  &lt;date&gt;2012-08-27 19:52:12&lt;/date&gt;
  &lt;subject&gt;printer not working&lt;/subject&gt;
  &lt;status&gt;Customer-Reply&lt;/status&gt;
  &lt;priority&gt;High&lt;/priority&gt;
  &lt;admin&gt;&lt;/admin&gt;
  &lt;lastreply&gt;2012-08-28 23:34:17&lt;/lastreply&gt;
  &lt;flag&gt;0&lt;/flag&gt;
  &lt;service&gt;&lt;/service&gt;
  &lt;replies&gt;
  &lt;reply&gt;
  </code></pre>
  
  <p>can anyone please tell me where is the problem? or any alternative ??</p>