Home > Backend Development > PHP Tutorial > PHP determines whether a string contains html tag_PHP tutorial

PHP determines whether a string contains html tag_PHP tutorial

WBOY
Release: 2016-07-13 10:25:04
Original
1077 people have browsed it

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

a');
echo '
';
judgeHtml('a');
Output: Yes
No

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825233.htmlTechArticlefunction judgeHtml($str){ if($str != strip_tags($str)){ echo 'Yes' ; }else{ echo 'none'; } } judgeHtml('pa'); echo 'br /'; judgeHtml('a'); Output: yes or no...
Related labels:
php
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