大番长一周目完美攻略-大番长bbb

大番长一周目完美攻略-大番长bbb
浏览 (160)
  • 类型:
  • 更新:2024-07-17
  • 大小:356M
  • 所需权限:查看
  • 隐私政策:查看
'dafanzhangbb.md', 'max_title_length' => 200, //避免递归太深 'title_mark' => '一章.', 'first_title_mark' => '※', ); $_config = array(); $_config$config'title_mark' = array(); if (!$config'first_title_mark') $config'first_title_mark' = ' '; $id2array = array(); ## Data 预处理 # 读取文件 $contents = readfile($config'file'); # 字符串 分割拼接 $contents = split_contents(split_contents($contents)); ## 递归 $tree = array(); get_tree($_config, $contents, $tree); ## 生成 树 $html = ''; while ($v = current($tree)) { if (isset($v'section')) {// first title if ($v'mark' != $config'first_title_mark') { $id = $v'id'; $ids$id = (isset($ids$id) ? $ids$id+1 : 1); $html.= '

' . $v'mark' . $ids$id . '. ' . $v'title' . '

'; $html.= '

' . get_substr($v'content') . '

'; } } else {// section if ($v'mark' != $config'first_title_mark') { $html.= '

' . $v'mark' . '. ' . $v'title' . '

'; $html.= '

' . get_substr($v'content') . '

'; } } next($tree); } echo '

大番长bbb

'; echo $html; echo '

End

'; echo '


'; echo '


'; function get_substr($content = '') { $content = substr($content, 0, $GLOBALS'config''max_title_length'); return $content; } ## function readfile($filename) { return trim(file_get_contents($filename)); } function split_contents($contents = '') { return array_filter(array_unique(split("\n", $contents))); } ## function get_tree($_config, $contents, &$tree) { while ($id=$contents) { $contents_v = split_contents($_config$id$id); $mark = array_shift($contents_v); if (!$mark || $mark == $GLOBALS'config''first_title_mark') { if (!$contents_v) continue; $contents_v = $_config$id = array( 'section' => '', 'id' => $id, 'mark' => $GLOBALS'config''first_title_mark', 'contents' => $contents_v0, 'title' => 'start: ' . $contents_v0, 'content' => isset($contents_v1) ? $contents_v1 : '', 'tree' => array(), 'level_key' => $id . '※', ); } else { $contents_v = $_config$id = array( 'section' => 'section', 'id' => $id, 'mark' => $mark, 'contents' => isset($contents_v3) ? $contents_v3 : $contents_v1, 'title' => trim($contents_v1), 'content' => isset($contents_v3) ? $contents_v3 : '', 'tree' => array(), 'level_key' => $id . $mark, ); } $tree = $_config$id; if ($contents_v'content') { if ($contents_v'level_key') { get_tree($_config$contents_v'level_key', $contents_v'contents', $tree$id'tree'); } else { get_tree($_config$contents_v'id', $contents_v'contents', $tree$id'tree'); } } } } ?>
安卓版下载

同类推荐更多

专题合集更多>>

极品飞车13手游下载-极品飞车13中文补丁免费版 玉之丞的冒险下载-玉之丞的冒险 搜款网官网版下载安装-搜款网官网版 一刀定胜负-一刀决胜负