我想知道有没有办法从一堆html代码中逃避所有html标签,并只提取文本即
<strong>this is strong</strong>
<br />
<h1> this is a header</h1>
Run Code Online (Sandbox Code Playgroud)
我想只在标签之间获取文本,所以基本上只是
this is strong this is a header
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
Run Code Online (Sandbox Code Playgroud)
我喜欢PHP的一个方面... Web开发人员的深思熟虑的功能.
归档时间: |
|
查看次数: |
7556 次 |
最近记录: |