This is a follow up question from here. But question is different.
I have the following array outputs.
Array $events
Array
(
[0] => Array
(
[day] => 17
[eventContent] => event 1 of 17th
[eventTitle] => 17th event 1
)
[1] => Array
(
[day] => 19
[eventContent] => event 1 of 19th
[eventTitle] => 19th event 1
)
[2] => Array
(
[day] => 05
[eventContent] => event 1 of 5th
[eventTitle] => 5th event 1
)
[3] => Array
(
[day] => 17
[eventContent] => event 2 of 17th
[eventTitle] => 17th event 2
)
[4] => Array
(
[day] => 19
[eventContent] => event 2 of 19th
[eventTitle] => 19th event 2
)
[5] => Array
(
[day] => 19
[eventContent] => event 3 of 19th
[eventTitle] => 19th event 3
)
)
And I want to pull outs day.
If I use this, it will pick up 1,2,3 etc. But I want 17, 19 etc.
if(array_key_exists($day,$events)){...
Could anyon tell me how to do it please?
Thanks in advance.
--UPDATE--
Original view which I need to modify.
if(array_key_exists($day,$events))
{
//adding the date_has_event class to the <td> and close it
echo ' class="date_has_event"> '.$day;
//adding the eventTitle and eventContent wrapped inside <span> & <li> to <ul>
echo '<div class="events"><ul>';?>
<?php foreach ($events as $event) : ?>
<li>
<span class="title"><?php echo $event['eventTitle']; ?></span>
<span class="desc"><?php echo $event['eventContent']; ?></span>
</li>
<?php endforeach; ?>
<?php
echo '</ul></div>';
}