求个正则

WBOY
Release: 2016-06-23 13:58:07
Original
808 people have browsed it

$str='

你好

';

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

p标签是变化的。

谢谢大家。谢谢。


回复讨论(解决方案)

$str='<p>你好</P>';echo strip_tags($str);
Copy after login
Copy after login

$str='

你好

';

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

p标签是变化的。

谢谢大家。谢谢。


我要的是正则,可以给个正则吗?

$str='<p>你好</P>';echo strip_tags($str);
Copy after login
Copy after login


我要的是正则,可以给个正则吗?

$str = '<p>你好</P>';preg_match('/>([^<]+)/', $str, $r);echo $r[1];
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