PHP FILTER_SANITIZE_ENCODED Filter
Definition and Usage
FILTER_SANITIZE_ENCODED filter removes or URL encodes unnecessary characters.
This function is very similar to the urlencode() function.
- Name: "encoded"
- ID-number: 514
Possible options or flags:
- FILTER_FLAG_STRIP_LOW - Remove ASCII values below 32
- FILTER_FLAG_STRIP_HIGH - Remove ASCII values above 32
- FILTER_FLAG_ENCODE_LOW - Encode ASCII values below 32
- FILTER_FLAG_ENCODE_HIGH - Encode ASCII values above 32
Example
<?php
var_dump(filter_var($url,FILTER_SANITIZE_ENCODED
));
?>
Output:
string(32) "http%3A%2F%2Fwww.codew3c.com"