PHP正则表达式替换<>及中间内容失败

WBOY
Release: 2016-06-06 20:29:16
Original
1152 people have browsed it

<code>2015-7-24                                         <a href="admin/news/1566.htm" title="标题:2015年转专业终审通过学生名单公告
点击率:2692" target="_blank" class="newslist_time">2015年转专业终审通过学生名单公告</a></code>
Copy after login
Copy after login

上面是需要处理的内容,用语句preg_replace('/<.>/', '', $content);</.>为什么不能将及中间内容删除?

回复内容:

<code>2015-7-24                                         <a href="admin/news/1566.htm" title="标题:2015年转专业终审通过学生名单公告
点击率:2692" target="_blank" class="newslist_time">2015年转专业终审通过学生名单公告</a></code>
Copy after login
Copy after login

上面是需要处理的内容,用语句preg_replace('/<.>/', '', $content);</.>为什么不能将及中间内容删除?

自己找到了,好象是因为有换行.匹配不了\n,先用\s\s+把空白格去掉,再用上面的语句就可以了

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