PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
// go through each of your database items in turn
foreach ($items as $item) {
//find the unix timestsamp
$timestamp = $item['timestamp'];
//find the month and year (as eg 'may2009')
$month = strtolower(date('MY', $timestamp));
//now turn 'may2009' (or whatever value $month has) into an array variable, and allocate $item to it
//note that a variable name cannot begin with a number, so it is important that $month contains the name of the month first and the year as a number afterwards
${$month}[] = $item;
}
//you now have a set of arrays $jan2009, $feb2009, $mar2009 etc which you can output with appropriate headings