This is a discussion on Setting a default filter within the Programming forums, part of the Tutorials category; If you use one type of filter predominantly, you can set a default filter and default flags. There are three ...
If you use one type of filter predominantly, you can set a default filter and default flags. There are three places you can do this: in php.ini; or, if you’re using an Apache server, in the Apache configuration file httpd.conf, or an .htaccess file.
The configuration directives that need to be changed are as follows:
filter.default: This should be followed by a string containing one of the names generated by filter_list()
filter.default_flags: This should be one of the flag constants to set more than one flag, separate each constant with a single vertical pipe (|).
To set the defaults in php.ini, remove the semicolon from the beginning of the line containing each directive, and put the value after the equal sign. The following directives set the default filter to convert into HTML entities single and double quotes, <, >, and &,
while the default flags strip all characters with an ASCII value of less than 32 or greater than 127:
filter.default = special_chars
filter.default_flags = FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH
To set the values in httpd.conf or an .htaccess file, use php_value, followed by the
directive and its value as a space-delimited list like this:
php_value filter.default special_chars
php_value filter.default_flags FILTER_FLAG_STRIP_LOW | å
FILTER_FLAG_STRIP_HIGH
Bookmarks