I have an array:
$events = array(
"0" => array('id' => '3', 'date' => '2009-05-08', 'title' => 'Test', 'spans' => '3'),
"1" => array('id' => '10', 'date' => '2009-05-23', 'title' => 'Test', 'spans' => '1'),
"2" => array('id' => '44', 'date' => '2009-05-16', 'title' => 'Test', 'spans' => '4'),
"3" => array('id' => '45', 'date' => '2009-05-16', 'title' => 'Test', 'spans' => '4')
);
I would like to "search" the array, for example:
if($events['date'] == '2009-05-16')
However I would like to limit the search to 1 item each time. As you can see there are two entries for the above date.
I would then like to display the data, for example:
echo $events['title'];
I would then like to remove the displayed entry, leaving me with:
$events = array(
"0" => array('id' => '3', 'date' => '2009-05-08', 'title' => 'Test', 'spans' => '3'),
"1" => array('id' => '10', 'date' => '2009-05-23', 'title' => 'Test', 'spans' => '1'),
"3" => array('id' => '45', 'date' => '2009-05-16', 'title' => 'Test', 'spans' => '4')
);
Any suggestions?