title: php foreach combine 2 array into 1 row (workdays & data)
body: <p>I have a problem with my current "Attendance Project", so I have 2 arrays.</p>
  
  <ul>
  <li>1st array is to show a "workdays"
  the 1st array show only workdays in current month ex:April, so the result in my 1st array is (3,4,5,6,7,10,11,12,13,14,17,18,19,20,21,24,25,26,27,28)</li>
  <li>2nd array is showing Employee Attendance in current month ex:April, so the result in my 2nd array is (17, 19)</li>
  </ul>
  
  <p>here is my current code :</p>
  
  <pre><code>&lt;table class="table table-striped table-bordered zero-configuration"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style="width: 200px"&gt;Siswa&lt;/th&gt;
              &lt;!-- &lt;?php for($i = 1; $i &lt; 31; ++$i){?&gt;
              &lt;th&gt;&lt;?= $i ?&gt;&lt;/th&gt;
              &lt;?php } ?&gt; --&gt;
              &lt;?php foreach($workdays as $w){ ?&gt;
              &lt;th&gt;&lt;?=$w;?&gt;&lt;/th&gt;
              &lt;?php } ?&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;?php 
          // for($x = 1; $x &lt; 27; ++$x){
          foreach($records as $r){
          ?&gt;
          &lt;tr&gt;
  &lt;td style="width: 200px"&gt;&lt;?=$r-&gt;StudentName;?&gt;&lt;/td&gt;
  &lt;?php
      ?&gt;
      &lt;?php 
           foreach($workdays as $w){
             foreach($tanggale as $t){ 
  
              if($w == $t){
              ?&gt;
                  &lt;td style="background: #FFF000"&gt;M&lt;/td&gt;
                  &lt;?php }else{ ?&gt;
                  &lt;td style="background: #48C9A9"&gt;O&lt;/td&gt;
                  &lt;?php } } } ?&gt;
          &lt;/tr&gt;
          &lt;?php }  ?&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>It will produce :
  <a href="https://i.stack.imgur.com/Rxw3Y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rxw3Y.jpg" alt="enter image description here"></a></p>
  
  <p>I want value (17 and 19) will markup the data with yellow background, and the table is NOT out of range.
  Any help will appreciate..</p>