Author of a PHP function that can delete HTML tags in a string: limote. when a visitor leaves a message or post a message, we do not want the visitor to use HTML tags in the message or post, so when a visitor submits a message or post, I have to delete the HTML tag. the following function is the function that implements this function & lt ;? Functiondelete_htm ($ scr) {for ($ i0; $ I & lt; strlen ($ scr) a PHP function that can delete HTML tags in a string
Author: limote
When a visitor leaves a message or post a message, we do not want the visitor to use HTML tags in the message or post. Therefore, when the visitor submits a message or post, I have to delete the HTML tag, the following function is used to implement 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 );
}
?>