title: How To Add A "Show More" Button To ForEach Loop?
body: <p>Hi I am looking to add a Show More / Load More button to this For Each loop.
  I am getting data from an API through JSON and displaying it in 3 columns.
  I would like to limit it to say 3 rows of three, then perhaps use another row with only 1 td with a button centred with a GET parameter adding more to a Limit variable?</p>
  
  <p>Here is my code how would be the best way to do this? Many thanks</p>
  
  <pre><code>$output = json_decode($output);
  curl_close($ch);
  $i = 0;
  echo '&lt;table border="0" align="center" padding-top="10px" padding-right="10px" padding-left="10px" padding-bottom="10px" style="width: 100% "&gt;';
  echo '&lt;tr &gt;';
  
  foreach($output as $template) {
      echo '&lt;td align="center"&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;' . '&lt;font color="#0083C1" size="5" face="sans-serif"&gt;'.$template-&gt;template_name .'&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;';
      echo '&lt;ul class="img-list"&gt;&lt;li&gt;&lt;a href="'.$template-&gt;preview_url.'" target="_blank"&gt;&lt;img src="'. $template-&gt;thumbnail_url.'" height="250" width="370"&gt;'.'&lt;span class="text-content"&gt;&lt;b&gt;'.'Preview Website'.'&lt;/b&gt;&lt;/span&gt;'.'&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;';
      echo '&lt;form method="GET" value="/websites/choose-your-website.php"&gt;';
      echo '&lt;input type="hidden" name="template_id" value="' . $template-&gt;template_id . '"&gt;';
      echo '&lt;input type="email" name="email" placeholder="Enter Your Email and Click Below" required" align="center" style="width: 250px"&gt;'.'&lt;br /&gt;';
      echo '&lt;button type="submit" align="center" class="button"&gt;Choose Site&lt;/button&gt;&lt;br /&gt;';
      echo '&lt;/form&gt;&lt;/td&gt;';        
      $i++;
      if($i == 3) {
          echo '&lt;/tr&gt;'.'&lt;tr&gt;';
          $i = 0;
      }
  }
  
  echo '&lt;/tr&gt;';
  echo '&lt;/table&gt;';   
  </code></pre>
  
  <p>The file is in PHP with JSON data pulling information from an API displaying in a PHP table</p>