开发者

Reordering pages?

function update_order($id, $direction) {
  // $pages = array($pageid => $position);
  $pages = array(3 => 1, 2 => 2, 1 => 3, 4 => 4, 5 => 5);

  // Update order
  $current = $pages[$id];
  $new = ($direction == 'up') ?开发者_如何学C ($pages[$id]++) : ($pages[$id]--);
  $old = '';

}

What is the quickest way to find the previous / next key from $current so I can add / deduct accordingly?


You could try to use

Previous

Current

Next

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜