The FILTER_SANITIZE_URL filter removes all illegal URL characters from the string.
This filter allows all letters, numbers, and $-_.+!*'(),{}|^~[]`"><#%;/?:@&=
Name: "url"
ID-number: 518
<?php$var="http://www.w3cschooåøl.cøc";var_dump(filter_var($var, FILTER_SANITIZE_URL));?>
The output of the code looks like this:
string(24) "http://www.w3cschool.cc"