note 118970 added to filter.filters.sanitize
| From: | Willscrlt | Date: | Thu, 10 Mar 2016 10:12:01 +0000 |
| Subject: | note 118970 added to filter.filters.sanitize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205125@lists.php.net to get a copy of this message | ||
To include multiple flags, simply separate the flags with vertical pipe symbols.
For example, if you want to use filter_var() to sanitize $string with FILTER_SANITIZE_STRING and
pass in FILTER_FLAG_STRIP_HIGH and FILTER_FLAG_STRIP_LOW, just call it like this:
$string = filter_var($string, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH |
FILTER_FLAG_STRIP_LOW);
The same goes for passing a flags field in an options array in the case of using callbacks.
$var = filter_var($string, FILTER_SANITIZE_SPECIAL_CHARS,
array('flags' => FILTER_FLAG_STRIP_LOW | FILTER_FLAG_ENCODE_HIGH));
Thanks to the Brain Goo blog at popmartian.com/tipsntricks/for this info.
----
Server IP: 72.52.91.14
Probable Submitter: 73.66.59.113
----
Manual Page -- http://php.net/manual/en/filter.filters.sanitize.php
Edit -- https://master.php.net/note/edit/118970
Del: integrated -- https://master.php.net/note/delete/118970/integrated
Del: useless -- https://master.php.net/note/delete/118970/useless
Del: bad code -- https://master.php.net/note/delete/118970/bad+code
Del: spam -- https://master.php.net/note/delete/118970/spam
Del: non-english -- https://master.php.net/note/delete/118970/non-english
Del: in docs -- https://master.php.net/note/delete/118970/in+docs
Del: other reasons-- https://master.php.net/note/delete/118970
Reject -- https://master.php.net/note/reject/118970
Search -- https://master.php.net/manage/user-notes.php