Home  >  Article  >  Backend Development  >  PHP开源论坛-YouYaX V11版本公布~无限盖楼

PHP开源论坛-YouYaX V11版本公布~无限盖楼

WBOY
WBOYOriginal
2016-06-13 12:51:42831browse

PHP开源论坛--YouYaX V11版本发布~无限盖楼~

本帖最后由 xjl756425616 于 2013-03-08 13:19:16 编辑 看图片




盖楼功能不会影响数据库中的内容,只是显示时,将其优化一下而已,操作数据不影响。

测试帖子地址:

http://www.youyax.com/forum/Content-index-id-4261.shtml

实现代码:

$result_data=array();
foreach($results as $v){
$num=preg_match_all("/
if($num>5){
$v['content1']=preg_replace("/([^<]+<\/legend>\s*)([^<]+<\/legend>\s*)([^<]+<\/legend>\s*)([^<]+<\/legend>\s*)([^<]+<\/legend>\s*){1,}([^<]+<\/legend>[^<]+)(<\/fieldset>[^<]+)(<\/fieldset>[^<]+){1,}(<\/fieldset>[^<]+)(<\/fieldset>[^<]+)(<\/fieldset>[^<]+)(<\/fieldset>)/is","\\1\\2\\3\\4部分楼层已被隐藏\\6\\8\\9\\10\\11\\12",$v['content1']);
}
$result_data[]=$v;
}
$this ->assign('data1', $result_data);


PS:这段实现的代码自己本来还不会,还是来源于我上次问的一个问题,csdn有很多高手啊~

共同进步~

------解决方案--------------------
共同进步
------解决方案--------------------
功能不错,美化一下视觉效果更好!
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn