关于列表调用帖子内容排除字符,高手帮忙下 本帖最后由 a291121289 于 2009-10-31 07:02:42 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是这个意思吗?$p = array('/(<).*?(>)/', '/(\[).*?(\])/');$thread['shortmsg'] = ' <font color=black>ffg</font>';$a = preg_replace($p, '', $thread['shortmsg']);print_r($a);echo "\n"; $thread['shortmsg'] = '<font color=black>'.preg_replace('/\ <\/?[a-z]{1,10}.{0,10}\>/is','',$thread[message]).'</font>';$thread['shortmsg'] = '<font color=black>'.preg_replace('/\ [\/?[a-z]{1,10}.{0,10}\]/is','',$thread[message]).'</font>';请问这两个怎么合起来,我单独用分别可以排除换行符和[]里的内容(包括符号) $thread['msg'] = "<font color=black\n>ffg</font>";$thread['shortmsg'] = preg_replace('/<.*?>|\[.*?\]/s', '', $thread['msg']); 为什么我的PHP程序运行却突然显示源代码? cookie在不同目录下取不到值 为什么数据老插入不到数据库 ? 菜鸟求解 php中define带有.的参数是什么意思 php数组转化 关于正则中一个菜菜的问题。。。 有谁知道哪儿的php空间比较不错,推荐一下 php菜鸟问题 这里有一段实现下载文件的代码,运行后为什么却在网页上显示文件内容,而不是下载? 请教global的使用方法,它的作用域如何理解?是在一个页面内有效,还是在多个页面? PHP不适合开发大型WEB应用? 关于列表调用帖子内容排除字符,高手帮忙下
$thread['shortmsg'] = ' <font color=black>ffg</font>';
$a = preg_replace($p, '', $thread['shortmsg']);
print_r($a);
echo "\n";
请问这两个怎么合起来,我单独用分别可以排除换行符和[]里的内容(包括符号)
$thread['shortmsg'] = preg_replace('/<.*?>|\[.*?\]/s', '', $thread['msg']);