title: How to print out a predetermined number on foreach loop?
body: <pre><code>&lt;?php 
  $stmt = $db-&gt;query("SELECT * FROM table LIMIT 5"); 
  foreach ($AnB as $aB): ?&gt;
    &lt;a href="#"&gt;
      &lt;div&gt;
        &lt;h6&gt;Number here&lt;/h6&gt;
        &lt;h5&gt;&lt;?php echo $aB['title'] ?&gt;&lt;/h5&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>As you can see, i used a LIMIT 5, i want to put a number on each loop, starting on number 1 till 5. How can i do it?</p>
  
  <p>This is how it should be:</p>
  
  <p><a href="https://i.stack.imgur.com/Qqbu1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qqbu1.jpg" alt="enter image description here"></a></p>