title: Create table in php using xml data
body: <p>I need to create results tables within the table. </p>
  
  <pre><code>&lt;?php
  $string = '&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;books&gt;
  &lt;book isbn="978-1594489501"&gt;
  &lt;title&gt;book Title 1&lt;/title&gt;
  &lt;author&gt;Author 1&lt;/author&gt;
  &lt;publisher&gt;publisher 1&lt;/publisher&gt;
  &lt;price&gt;price 1&lt;/price&gt;
  &lt;genre&gt;English 1&lt;/genre&gt;
  &lt;/book&gt;
  &lt;book isbn="978-1594489502"&gt;
  &lt;title&gt;book Title 2&lt;/title&gt;
  &lt;author&gt;Author 2&lt;/author&gt;
  &lt;publisher&gt;publisher 2&lt;/publisher&gt;
  &lt;price&gt;price 2&lt;/price&gt;
  &lt;genre&gt;English 2&lt;/genre&gt;
  &lt;/book&gt;
  &lt;/books&gt;';
  $xml = new SimpleXMLElement($string);
  $string = 'book';
  $result = $xml-&gt;xpath("//book[contains(translate(title,
  'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), '".strtoupper($string)."')]"); 
  foreach($result as $one){
  echo "&lt;table border='1' width='500'&gt;\n";
  echo "&lt;tr&gt;&lt;th&gt;Title&lt;/th&gt;&lt;td&gt;$one-&gt;title&lt;/td&gt;&lt;/tr&gt;\n";
  echo "&lt;tr&gt;&lt;th&gt;Author&lt;/th&gt;&lt;td&gt;$one-&gt;author&lt;/td&gt;&lt;/tr&gt;\n";
  echo "&lt;tr&gt;&lt;th&gt;Publisher&lt;/th&gt;&lt;td&gt;$one-&gt;publisher&lt;/td&gt;&lt;/tr&gt;\n";
  echo "&lt;tr&gt;&lt;th&gt;Price&lt;/th&gt;&lt;td&gt;$one-&gt;price&lt;/td&gt;&lt;/tr&gt;\n";
  echo "&lt;tr&gt;&lt;th&gt;Genre&lt;/th&gt;&lt;td&gt;$one-&gt;genre&lt;/td&gt;&lt;/tr&gt;\n";
  echo "&lt;/table&gt;\n";  
  }
  ?&gt;
  </code></pre>
  
  <p>In HTML CODE Like this
              <pre></p>
  
  
      
          
                              
                  Result 1
                  Title: Title 1   
                  Author: Author 1     
                  Publish: publish 1     
                  Price: price 1     
                  Genre: English 1
                                  
          
          
              
                  Result 2                     
                  Title: Title 2   
                  Author: Author 2     
                  Publish: publish 2     
                  Price: price 2     
                  Genre: English 2
                          
          
          
              
                  Result 3                
                  Title: Title 3   
                  Author: Author 3     
                  Publish: publish 3     
                  Price: price 3     
                  Genre: English 3
                                         
          
          
        
          
              
                  Result 4                
                  Title: Title 4   
                  Author: Author 4     
                  Publish: publish 4     
                  Price: price 4     
                  Genre: English 4
                                        
          
          
              
                  Result 5                 
                  Title: Title 5   
                  Author: Author 5     
                  Publish: publish 5     
                  Price: price 5     
                  Genre: English 5
                                    
          
          
              
                  Result 6                
                  Title: Title 6   
                  Author: Author 6     
                  Publish: publish 6     
                  Price: price 6     
                  Genre: English 6
                                   
          
      
  
  
  <p></pre></p>