- function judgeHtml($str){
- if($str != strip_tags($str)){
- echo '有';
- }else{
- echo '无';
- }
- }
- judgeHtml('<p>a');
- echo '<br />';
- judgeHtml('a');
输出:有
无
- function judgeHtml($str){
- if($str != strip_tags($str)){
- echo '有';
- }else{
- echo '无';
- }
- }
- judgeHtml('<p>a');
- echo '<br />';
- judgeHtml('a');
输出:有
无