Foreach issue


I have this iCal jQuery Calendar, and a MySQL database. I have used PHP to populate it. Currently, it shows events in the future on the calendar, however I’d like it to also show past events. The variable for past events is $history. I’ve tried foreach(array_merge($history, $events) as $event) but it does not work, the calendar just disappears.

This is the documentation for the calendar:

And this is the code I have, excluding JavaScript:

							$dates = array();

							// build an array with that data
							foreach($events as $event)
							  $dates[] = (object)array(
								 'date'  => date('Y-m-d', strtotime($event->date)),
								 'title' => $event->title,
								 'desc'  => sprintf('<a href="%s/index.php/events/get_event?id=%s">Click for more info and to sign up.</a>', SITE_URL, $event->id),


Hi HighFlyer,

I’ve moved your post as it is better suited for the PHP forum.