title: Reading from xml file using PHP to putput in html - error
body: <p>I am trying to read an XML file (not generated by me)
  and output it in HTML</p>
  
  <p>Code as below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php    $feed = "includes/captaincooks.xml";
  $results = simplexml_load_file($feed); foreach ($results as $product);
  
  //var_dump($results);
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"/&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
  &lt;/head&gt;
  &lt;body&gt;    &lt;ul&gt;
          &lt;li&gt;&lt;img src="&lt;?php echo $product-&gt;img_url; ?&gt;" alt="&lt;?php echo $product-&gt;name; ?&gt;" /&gt;&lt;/li&gt;
          &lt;li&gt;Product URL: &lt;?php echo $product-&gt;purl; ?&gt; &lt;/li&gt;
          &lt;li&gt;Description: &lt;?php echo $product-&gt;desc; ?&gt;&lt;/li&gt;
          &lt;li&gt;Price: &lt;?php echo $product -&gt;price; ?&gt;  &lt;/li&gt;
          &lt;li&gt;&lt;a href="&lt;?php echo $product-&gt;deeplink; ?&gt;"&lt;?php echo $product-&gt;product_name; ?&gt;"&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;                                                     
   &lt;/body&gt;
  &lt;/html&gt;  </code></pre>
  </div>
  </div>
  </p>
  
  <p>on the web page i get this error about an ';' ?</p>
  
  <p>it seems to read the xml file and get the various bits of data just doesn't like something in the simplexml_load_file line 2</p>
  
  <p>error is (showing 1 line only, many lines all pretty much the same except the data that's read)</p>
  
  <pre><code>Warning: simplexml_load_file(): includes/captaincooks.xml:1: parser error : EntityRef: expecting ';' in /home/picnicpa/public_html/includes/captaincooks.html on line 2
  </code></pre>
  
  <p><code>captaincooks.html</code> is the data i wrote above
  <code>captaincooks.xml</code> is the xml file</p>
  
  <p>Any ideas welcome</p>
  
  <p>Tony</p>