PHP FILTER_SANITIZE_ENCODED filter
Definition and Usage
FILTER_SANITIZE_ENCODED filter to remove unwanted characters or URL-encoded.
The filter and the urlencode () function is very similar.
- Name: "encoded"
- ID-number: 514
Possible signs:
- FILTER_FLAG_STRIP_LOW - removal of characters in the ASCII value of 32 or less
- FILTER_FLAG_STRIP_HIGH - the removal of more than 32 characters in the ASCII value of
- FILTER_FLAG_ENCODE_LOW - encoded characters in the ASCII value of 32 or less
- FILTER_FLAG_ENCODE_HIGH - encoded ASCII value of the character above 32
Examples
<?php
$url="http://www.w3cschool.cc";
var_dump(filter_var($url,FILTER_SANITIZE_ENCODED));
?>
$url="http://www.w3cschool.cc";
var_dump(filter_var($url,FILTER_SANITIZE_ENCODED));
?>
Output code is as follows:
string(30) "http%3A%2F%2Fwww.w3cschool.cc"
Complete PHP Filter Reference