Posted by deko on 02/27/07 22:30
$i =1
foreach ($category as $cat_item)
{
echo $cat_item->cat_name;
foreach ($itemdata as $item_datum)
{
if ($item_datum->category_id == $cat_item->cat_id)
{
echo '--'.$item_datum->item_name;
array_splice($itemdata, $item_data[$i - 2], 1);
reset($itemdata);
}
}
}
This seems to work.
Is there a way to access the array indexer so I don't have to use $i?
I tried prev($itemdata) but could not get that to work for some reason....
[Back to original message]
|