>>532訂正
$delって変数があるの見落としてた

$line = preg_replace_callback(
  "!<a href=\"\.\./test/read\.php/$_POST['bbs']/$_POST['key']/([\d|\-]+)\" target=\"_blank\">&gt;&gt;([\d|\-]+)</a>!",
  'callback_hoge', $line);

function callback_hoge($matches)
{
  return "<a href=\"../test/read.php/$_POST['bbs']/$_POST['key']/" . res_num($matches[1], $GLOBALS['del']). '\" target=\"_blank\">&gt;&gt;' . res_num($matches[2], $del) . '</a>';
}

クロージャ使うなら

$line = preg_replace_callback(
  "!<a href=\"\.\./test/read\.php/$_POST['bbs']/$_POST['key']/([\d|\-]+)\" target=\"_blank\">&gt;&gt;([\d|\-]+)</a>!",
  function ($matches) use ($del) {
    return "<a href=\"../test/read.php/$_POST['bbs']/$_POST['key']/" . res_num($matches[1], $del). '\" target=\"_blank\">&gt;&gt;' . res_num($matches[2], $del) . '</a>';
  },
  $line
);