<html>
<body>
// Variable to check
$url="https://www.xn--w3schools-8taa.com/";
// Encode characters
$url = filter_var($url, FILTER_SANITIZE_ENCODED);
echo $url;
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_sanitize_encoded by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:10:00 GMT -->
</html>