Link to home
Start Free TrialLog in
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.
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial