[eluser]ehalber[/eluser]
Hi sophistry and thanks for your reply...I ended up solving the problem like this:
Code:
foreach ($events as $event)
{
if ( array_key_exists( $event->day, $calendar ) )
{
$calendar[$event->day] = $calendar[$event->day] .'<br />'.
anchor(base_url() .'admin/calendar/'. $year .'/'. $month .'/'.
$event->id, $event->name);
}
else
{
$calendar[$event->day] = anchor(base_url() .'admin/calendar/'.
$year .'/'. $month .'/'. $event->id, $event->name) ;
}
}
This enables me to check whether or not an array key exists...if it does great, we'll just append some data to it, otherwise, just create a new entry.
In your post you mentioned nested arrays...
[quote author="sophistry" date="1202867826"]the code here:
if you don't want to modify the current code you have (which i'd suggest you do if you want multiple events per day), just use a nested array for the events.
[/quote]
I'm not sure if that's what I did ( still a very new to the development stuff ), but would you mind elaborating a little. Thank you.