<?php $str='<p>this is a test.</p><!--comment-->hello world!'; print_r(strip_tags($str)); echo '<br>'; print_r(strip_tags($str,'<p>')); ?> 结果: this is a test.hello world! this is a test. hello world!