Help Multidimensional array PHP?

franc

New member
<?php

$daily_acts = array("S" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout),
"M" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout),
"T" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout),
"W" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout),
"Th" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout),
"F" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout),
"Sa" =>array([act1] => Pushup,
[act2] => Roadwork,
[act3] => weightlifting,
[act4] => swimming,
[act5] => punchingbag,
[act6] => aerobics,
[act7] => bicepswork,
[act8] => bicycleexercise,
[act9] = > cardiacworkout));

//what i wanna do is to create a script that prints out the day of the week, act number and activity
//like this
// S [act1] Pushup
// S [act2] Roadwork... so on and so forth for each of the days of the week
//how do i go about doing that


// i have tried using the following code but the days of the week don't print out

foreach ($daily_acts as $show) {
foreach ($show as $key => $value){
echo "$key : $value
\n";
}
}
?>
 
Back
Top