How to use FILTER SANITIZE ENCODED in PHP
This article describe about FILTER_SANITIZE_ENCODED Filter in PHP.
FILTER_SANITIZE_ENCODED Filter
For filter strips or URL-encodes unwanted characters use FILTER_SANITIZE_ENCODED.
Like urlencode() function FILTER_SANITIZE_ENCODED work a lot.
- Name: "encoded"
- ID-number: 514
Possible flags:
- FILTER_FLAG_ENCODE_LOW - Encode characters with ASCII value below 32
- FILTER_FLAG_ENCODE_HIGH - Encode characters with ASCII value above 32
- FILTER_FLAG_STRIP_LOW - Strip characters with ASCII value below 32
- FILTER_FLAG_STRIP_HIGH - Strip characters with ASCII value above 32
Example
<html>
<body>
<?php
$url="https://dotnetheaven.com";
var_dump(filter_var($url,FILTER_SANITIZE_ENCODED));
?>
</body>
</html> |
Output
You may also want to read these related articles Click here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here