i am trying to create an array which stores various photo albums,
so far i have the following code
$photos = array(
array("karate","1","2"),
array("judo","1","2"),
array("kickboxing","1","2"),
array("womenselfdefense","1","2")
);
$sections = array("karate","judo","kickboxing","womenselfdefense");
foreach($sections as $keys => $section)
{
echo count($photos[$section]);
}
but i dont think i have set up my arrays properly, ideally i'd like the main array $photos to have 4 separate arrays $karate,$judo,$kickboxing,$womenselfdefense within it.
i want to start of by counting the number of items in each array and then choose a random item within each array, however i believe at the moment i have 4 unnamed arrays within the photos array and therefor my code returns several Undefined index: errors
can anyone help me with this please
print_r($photos)that should show you your mistake