title: Using SimpleXML to load remote URL
body: <p>I am trying to use SimpleXML to load a remote URL. </p>
  
  <p>If I type into my browser the following;</p>
  
  <pre><code>http://api.ean.com/ean-services/rs/hotel/v3/list?cid=55505&amp;minorRev=12&amp;apiKey=2hkhej72gxyas3ky6hhjtsga&amp;locale=en_US&amp;currencyCode=USD&amp;customerIpAddress=10.184.2.9&amp;customerUserAgent=Mozilla/5.0+(Windows;+U;+Windows+NT+6.1;+en-US;+rv:1.9.2.25)+Gecko/20111212+Firefox/3.6.25&amp;customerSessionId=&amp;xml=&lt;HotelListRequest&gt;&lt;arrivalDate&gt;01/22/2012&lt;/arrivalDate&gt;&lt;departureDate&gt;01/24/2012&lt;/departureDate&gt;&lt;RoomGroup&gt;&lt;Room&gt;&lt;numberOfAdults&gt;1&lt;/numberOfAdults&gt;&lt;numberOfChildren&gt;1&lt;/numberOfChildren&gt;&lt;childAges&gt;4&lt;/childAges&gt;&lt;/Room&gt;&lt;/RoomGroup&gt;&lt;city&gt;Amsterdam&lt;/city&gt;&lt;countryCode&gt;NL&lt;/countryCode&gt;&lt;supplierCacheTolerance&gt;MED&lt;/supplierCacheTolerance&gt;&lt;/HotelListRequest&gt; 
  </code></pre>
  
  <p>It works!</p>
  
  <p>If I try;</p>
  
  <pre><code>$url = 'http://api.ean.com/ean-services/rs/hotel/v3/list?cid=55505&amp;minorRev=12&amp;apiKey=2hkhej72gxyas3ky6hhjtsga&amp;locale=en_US&amp;currencyCode=USD&amp;customerIpAddress=10.184.2.9&amp;customerUserAgent=Mozilla/5.0+(Windows;+U;+Windows+NT+6.1;+en-US;+rv:1.9.2.25)+Gecko/20111212+Firefox/3.6.25&amp;customerSessionId=&amp;xml=&lt;HotelListRequest&gt;&lt;arrivalDate&gt;01/22/2012&lt;/arrivalDate&gt;&lt;departureDate&gt;01/24/2012&lt;/departureDate&gt;&lt;RoomGroup&gt;&lt;Room&gt;&lt;numberOfAdults&gt;1&lt;/numberOfAdults&gt;&lt;numberOfChildren&gt;1&lt;/numberOfChildren&gt;&lt;childAges&gt;4&lt;/childAges&gt;&lt;/Room&gt;&lt;/RoomGroup&gt;&lt;city&gt;Amsterdam&lt;/city&gt;&lt;countryCode&gt;NL&lt;/countryCode&gt;&lt;supplierCacheTolerance&gt;MED&lt;/supplierCacheTolerance&gt;&lt;/HotelListRequest&gt; ';
  $xml = simplexml_load_file($url);
  </code></pre>
  
  <p>I get met with the following error;</p>
  
  <pre><code>Warning: simplexml_load_file() [function.simplexml-load-file]: http://api.ean.com/ean-services/rs/hotel/v3/list?cid=55505&amp;minorRev=12&amp;apiKey=2hkhej72gxyas3ky6hhjtsga&amp;locale=en_US&amp;currencyCode=USD&amp;customerIpAddress=10.184.2.9&amp;customerUserAgent=Mozilla/5.0%2B(Windows;%2BU;%2BWindows%2BNT%2B6.1;%2Ben-US;%2Brv:1.9.2.25)%2BGecko/20111212%2BFirefox/3.6.25&amp;customerSessionId=&amp;xml=%3CHotelListRequest%3E%3CarrivalDate%3E01/22/2012%3C/arrivalDate%3E%3CdepartureDate%3E01/24/2012%3C/departureDate%3E%3CRoomGroup%3E%3CRoom%3E%3CnumberOfAdults%3E1%3C/numberOfAdults%3E%3CnumberOfChildren%3E1%3C/numberOfChildren%3E%3CchildAges%3E4%3C/childAges%3E%3C/Room%3E%3C/RoomGroup%3E%3Ccity%3EAmsterdam%3C/city%3E%3CcountryCode%3ENL%3C/countryCode%3E%3CsupplierCacheTolerance%3EMED%3C/supplierCacheTolerance%3E%3C/HotelListRequest%3E%20:1: parser error : Start tag expected, '&lt;' not found in C:\Program Files\XAMPP\xampplite\htdocs\hotel\results.php on line 29
  </code></pre>
  
  <p>The most notable part of that error is: <strong>parser error : Start tag expected, '&lt;' not found</strong></p>
  
  <p>I would like to access that file and use PHP/SimpleXML to format the results - but thus far I am stuck.</p>
  
  <p>I thought that this thread <a href="https://stackoverflow.com/questions/7806458/simplexml-load-file-with-ampersand-in-url-with-solr" title="HERE">HERE</a> which talks about rawurlencode may have helped but it didn't, either that or I'm missing something. </p>