Jazzy 1012
asked on
Length of for loop to be dynamic
I have this code:
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
$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++)
{
?>
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://php.net/manual/en/control-structures.foreach.php