title: removing <?xml version="1.0" tag from XML in php
body: <p>I have a function returning a xml but returns a xml with two </p>
  
  <pre><code>   &lt;?xml version="1.0"?&gt;
  </code></pre>
  
  <p>tags</p>
  
  <p>I cannot fix the call to return it with one call. Im trying to use SimpleXMLElement so when i load this xml into simplexml it gives a error because of the duplicate tags. Anyone know how i can remove the tag before loading to xml </p>
  
  <p>I have tried doing </p>
  
  <pre><code>$new_xml = preg_replace('/&lt;?xml(.*)?&gt;(.*)?&lt;\/?&gt;/', '', $xml);
  </code></pre>
  
  <p>I have also done (which works by the way. Just not sure if its the best way since im not sure if there may at times be more info inside the 
  
  <pre><code>  $xml = str_replace('&lt;?xml version="1.0"?&gt;', '', $xml);
  </code></pre>