PHP Source:
<!DOCTYPE html>
<html>
<body>

<?php
// Variable to check
$url="http://www.w3schools��.com";

// Encode characters
$url = filter_var($url, FILTER_SANITIZE_ENCODED);
echo $url;
?>


</body>
</html>
Result:
Show PHP - © www.w3ii.com