Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
// Variable to check
$url = "https://www.w3schools.com";
// Remove all illegal characters from a url
$url = filter_var($url, FILTER_SANITIZE_URL);
// Validate url
if (filter_var($url, FILTER_VALIDATE_URL)) {
  echo("$url is a valid URL");
} else {
  echo("$url is not a valid URL");
}
?>
</body>
</html>
https://www.w3schools.com is a valid URL