Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
// Variable to check
$url="https://www.w3schools排.com";
// Encode characters and remove all characters with ASCII value > 127
$url = filter_var($url, FILTER_SANITIZE_ENCODED, FILTER_FLAG_STRIP_HIGH);
echo $url;
?> 
</body>
</html>
https%3A%2F%2Fwww.w3schools.com