Php filters all html tags. First, we recommend that the filter_sanitize_string and filter_sanitize_string filters remove or encode unnecessary characters. This filter deletes data that is potentially harmful to the application. First, we recommend filter_sanitize_string and filter_sanitize_string filters to remove or encode unnecessary characters.
This filter deletes data that is potentially harmful to the application. It is used to remove tags and delete or encode unnecessary characters.
Name: "string"
Id-number: 513
Possible options or flag:
Filter_flag_no_encode_quotes-this flag is not encoded with quotation marks
Filter_flag_strip_low-remove characters with ascii values below 32
Filter_flag_strip_high-remove characters with ascii values greater than 32
Filter_flag_encode_low-characters encoded with ascii values below 32
Filter_flag_encode_high-encode characters with ascii values greater than 32
Filter_flag_encode_amp-encode & character &
*/
$ Var ="Bill gates";
Var_dump (filter_var ($ var, filter_sanitize_string ));
/*
The second function is strip_tags.
The strip_tags () function removes tags from html, xml, and php tutorials.
Syntax
Strip_tags (string, allow)
*/
Echo strip_tags ("helloWorld!");
// Hello world!
Function uh ($ str)
{
$ Farr = array (
"/S + /",
// Filter unnecessary spaces
"/<(/?) (Script | I? Frame | style | html | body | title | link | meta |? | %) ([^>] *?)> /Isu ",
// FilterTo join "/(<[^>] *) On [a-za-z] + s * = ([^>] *>)/isu ",
// Filter the on events of webpage special effects
);
$ Tarr = array (
"",
"<123>", // If you want to directly clear insecure labels, leave it blank.
"12 ",
);
$ Str = preg_replace ($ farr, $ tarr, $ str );
Return $ str;
}
For more details, see http://www.bKjia. c0m/phper/19/70 dd2a905e74cefc9be9c0f17268dadc.htm
?>
Characters removed from the filters or not required for encoding. This filter deletes data that is potentially harmful to the application. It...