cristianods
New member
The first problem that you have here is that you have a double key on the array, the S key. Change it to correct the array otherwise any code will fail.
BTW: All act keys should be string, so 'act1' and so on...
The code that you have wrote is almost correct, but here are some small tweaks..
<?php
foreach ($daily_acts as $day => $schedule)
{
switch($day)
{
case 'S':
echo 'Sunday <br />';
break;
// so on until saturday
default:
// do nothing
break;
}
foreach ($schedule as $act => $workType)
{
echo "{$act} {$workType} <br />";
}
}
?>
Now all you got to do is tweak it to work for you
BTW: All act keys should be string, so 'act1' and so on...
The code that you have wrote is almost correct, but here are some small tweaks..
<?php
foreach ($daily_acts as $day => $schedule)
{
switch($day)
{
case 'S':
echo 'Sunday <br />';
break;
// so on until saturday
default:
// do nothing
break;
}
foreach ($schedule as $act => $workType)
{
echo "{$act} {$workType} <br />";
}
}
?>
Now all you got to do is tweak it to work for you