title: How can I export values from a database and echo all it separated by an &lt;hr /&gt;, except the first and the last results?
body: <p>How can I export values from a database and echo all it separated by an &lt;hr /&gt;, except the first and the last results??</p>
  
  <pre><code>$stmt = $db-&gt;prepare("SELECT `title`, `content` FROM `news` ORDER BY title ASC");
  $stmt-&gt;execute(array($category));
  foreach($stmt as $row){
      echo "&lt;p&gt;" . $row['title'];
      echo $row['content'] . "&lt;/p&gt; &lt;hr /&gt;";
  }
  </code></pre>
  
  <p>it outputs:</p>
  
  <pre><code>&lt;p&gt;title1
  content1&lt;/p&gt;
  &lt;hr&gt;
  &lt;p&gt;blabla
  blabla&lt;/p&gt;
  
  &lt;!--My question is how to remove this hr--&gt;
  &lt;hr&gt;
  </code></pre>
  
  <p>I tried to use a for cicle, but it didn't work.</p>
  
  <p>thanks in advance</p>