Home > Backend Development > PHP Tutorial > 求个正则,该怎么解决

求个正则,该怎么解决

WBOY
Release: 2016-06-13 11:55:55
Original
867 people have browsed it

求个正则
$str='

你好

';

请问怎么匹配出‘你好’?

p标签是变化的。

谢谢大家。谢谢。
------解决方案--------------------
$str='<p>你好</P>';<br />echo strip_tags($str);
Copy after login

------解决方案--------------------
$str = '<p>你好</P>';<br />preg_match('/>([^<]+)/', $str, $r);<br />echo $r[1];<br />
Copy after login
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