title: simplexml_load_file() with a variable
body: <p>I'm currently having an issue with simplexml_load_file(); my xml path is a url, that is rendered as a variable</p>
  
  <pre><code>$xurl = "domain/pathto/myfile.xml"; //  This is actually a variable that returns the entire URL to where my xml file is -- this will change from file to file
  
  
  $xmlpath = parse_url($xurl, PHP_URL_PATH); // to get the path of my xml file ex. /pathto/myfile.xml 
  
  $xmlpath = mb_substr($xmlpath, 1);  // returns pathto/myfile.xml
  </code></pre>
  
  <p>here is where my problem is, when I put it into :</p>
  
  <pre><code>simplexml_load_file($xmlpath);
  </code></pre>
  
  <p>In my function, I get nothing appearing from the XML file</p>
  
  <p>However, in my same function if I change it to </p>
  
  <pre><code>simplexml_load_file("pathto/myfile.xml");
  </code></pre>
  
  <p>My function works fine.</p>
  
  <p>I did an echo on $xmlpath and it returns the pathto/myfile.xml just fine. </p>
  
  <pre><code>&lt;?php echo $xmlpath; ?&gt; // returns pathto/myfile.xml
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>EDIT: Phil</p>
  
  <pre><code>echo strcmp("pathto/myfile.xml", $xmlpath)
  </code></pre>
  
  <p>returns a 0.</p>