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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:29:16
Original
1185 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:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template