title: Foreach loop using phpquery
body: <p>I'm using phpquery to loop through a table and extract the contents of each  tag into their own variable.</p>
  
  <pre><code>foreach(pq('.body table tr') as $tag) {
    foreach(pq($tag)-&gt;find('td.fixData') as $td) {
      $x = pq($td)-&gt;text();
      echo '&lt;p&gt;'.$x.'&lt;/p&gt;';
    }
  }
  </code></pre>
  
  <p>However its putting every single match within a <p> tag</p>
  
  <p>What I'd like to do is put <p>First second third fourth</p></p>
  
  <p>Any ideas?</p>