Home > php教程 > php手册 > php 判断字符串中是否包含html标签

php 判断字符串中是否包含html标签

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:24:50
Original
1806 people have browsed it

本篇文章主要是对使用php判断字符串中是否包含html标签的实例代码进行了介绍,需要的朋友可以过来参考下,希望对大家有所帮助

function judgeHtml($str){
 if($str != strip_tags($str)){
  echo '有';
 }else{
  echo '无';
 }
}
judgeHtml('

a');
echo '
';
judgeHtml('a');
输出:有
      无 ,

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template