I have an array and I need to truncate this array down to only contain the information I need.
The reference date is in the following format;
$reference_date = '20120624';
I need to turn this array…
array(3) {
[0]=>
array(3) {
["ID"]=>
string(2) "15"
["start_time"]=>
string(19) "2012-06-24 08:00:00"
["end_time"]=>
string(19) "2012-06-24 17:00:59"
}
[1]=>
array(3) {
["ID"]=>
string(2) "28"
["start_time"]=>
string(19) "2012-07-26 18:00:00"
["end_time"]=>
string(19) "2012-07-26 22:00:59"
}
[2]=>
array(3) {
["ID"]=>
string(2) "31"
["start_time"]=>
string(19) "2012-07-28 00:00:00"
["end_time"]=>
string(19) "2012-07-28 23:59:59"
}
}
into this…
array(1) {
[0]=>
array(3) {
["ID"]=>
string(2) "15"
["start_time"]=>
string(19) "2012-06-24 08:00:00"
["end_time"]=>
string(19) "2012-06-24 17:00:59"
}
There can be more than one array with the same date (different times). I need to preserve these as well.
I have tried various ways of unsetting but my understanding is just not there yet.
Regards
1 Answer