Avatar of Jazzy 1012
Jazzy 1012

asked on 

Length of for loop to be dynamic

I have this code:
          <?php
          
          $available = array();
          
          while ($row3 = mysqli_fetch_assoc($result3))
          {
              
              $dayt = $row3['day_of_week'];
              $times = $row3['time_window_label'];
              $tt= explode(",",$times);
              
              $available[$dayt][] = trim($tt[1]);
          }

      for ($x=0; $x<3; $x++)
      {
      	?>

Open in new window


I want the for loop instead of being < 3 , to be the length of the array that if its 2 rows then just 2 if 3, 3 if more, more. etc.
PHP

Avatar of undefined
Last Comment
zephyr_hex (Megan)

8/22/2022 - Mon