I have a multi-dimensional array right now that looks like this:
function art_appreciation_feeds() {
$items = array(
array('site' => '', 'uri' => '', 'feed' => ''),
array('site' => '', 'uri' => '', 'feed' => ''),
array('site' => '', 'uri' => '', 'feed' => ''),
array('site' => '', 'uri' => '', 'feed' => ''),
);
return $items;
}
Right, so I output the values of the array using this function:
foreach($items as $i => $row) {
What I'm looking to do, is add another value to that array called category
so that I'd have:
array(
array('site' => '', 'uri' => '', 'feed' => '', 'category' => ''),
);
And when I'm going through the loop above, to output it in order by the category
field with a <h2>Category</h2>
at the top only of each section.
Is that the best way to do this and if so, how would I change my loop to accommodate that? Caveat: I can change the array as well if you think something else is better.
Thanks!