I have a list in php with the following structure:
$center = '2';
$all = array(
array(
'foo'=>'abc',
'bar'=>'def',
'order' => 2
),
array(
'foo'=>'abc',
'bar'=>'def',
'order' => 5
),
array(
'foo'=>'abc',
'bar'=>'def',
'order' => 11
),
//..etc
);
what I'd like to do is get the array before and after the array where order == $center. What's the best way to accomplish this?