title: How to restart loop with different variable in php/html
body: <p>as you can see im doing a loop as below.
  There are 2 data set involved:</p>
  <pre><code>$transaction_list_pending;
  $transaction_list_completed;
  
      &lt;?php
          foreach($transaction_list_pending as $transaction) {
      ?&gt; 
          &lt;div id=&quot;P&lt;?php echo $transaction-&gt;trans_id; ?&gt;&quot; class=&quot;modal fade&quot; role=&quot;dialog&quot; aria-hidden=&quot;true&quot;&gt;
              &lt;div class=&quot;modal-dialog modal-dialog-centered transaction-details&quot; role=&quot;document&quot;&gt;
                  &lt;div class=&quot;modal-content&quot;&gt;
                      some content
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;?php } ?&gt;
  </code></pre>
  <p>How do i restart this same loop by using <code>$transaction_list_completed</code> as the variable in the foreach statement?</p>
  <p>Suggestion to copy the loop is not what im looking for (maybe if no other solution) as the html content for this Modal consists of hundreds of code line.</p>