A PHP function that can remove HTML tags in strings_PHP tutorial

WBOY
Release: 2016-07-21 16:01:31
Original
723 people have browsed it

A PHP function that can remove HTML tags in strings
Author: limote


When visitors leave messages and posts, we do not want visitors to use HTML tags in their comments and posts, so when visitors When submitting comments and posts, we have to delete the HTML tags. The following function is the function that implements this function
function delete_htm($scr)
{
for($i=0 ;$i{
if(substr($scr,$i,1)=="<")
{
while(substr( $scr,$i,1)!=">")$i++;
$i++;
}
$str=$str.substr($scr,$i,1);
}
return($str);
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/316784.htmlTechArticleA PHP function that can remove HTML tags in strings Author: limote When visitors leave messages and posts, we do not Visitors are expected to use HTML tags in their comments and posts...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template