原创 PHP中如何獲得數組中指定元素的前一個或後一個元素

方法一:用循環 function getNext(&$array, $curr_key) {     $next = 0;     reset($array);     do     {         $tmp_key = key($