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

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

WBOY
Release: 2016-06-13 11:17:31
Original
823 people have browsed it

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

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




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

测试帖子地址:

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

实现代码:

$result_data=array();<br />        foreach($results as $v){<br />        	$num=preg_match_all("/<fieldset/",$v['content1'],$tmp);<br />        	if($num>5){<br />        		$v['content1']=preg_replace("/(<fieldset[^<]+<legend>[^<]+<\/legend>\s*)(<fieldset[^<]+<legend>[^<]+<\/legend>\s*)(<fieldset[^<]+<legend>[^<]+<\/legend>\s*)(<fieldset[^<]+<legend>[^<]+<\/legend>\s*)(<fieldset[^<]+<legend>[^<]+<\/legend>\s*){1,}(<fieldset[^<]+<legend>[^<]+<\/legend>[^<]+)(<\/fieldset>[^<]+)(<\/fieldset>[^<]+){1,}(<\/fieldset>[^<]+)(<\/fieldset>[^<]+)(<\/fieldset>[^<]+)(<\/fieldset>)/is","\\1\\2\\3\\4<span style=\"color:#388600;position:relative;top:8px;left:10px;\">部分楼层已被隐藏</span>\\6\\8\\9\\10\\11\\12",$v['content1']);<br />        	}<br />        	$result_data[]=$v;<br />        }<br />        $this ->assign('data1', $result_data);
Copy after login


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

共同进步~

------解决方案--------------------
共同进步
------解决方案--------------------
功能不错,美化一下视觉效果更好!
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template