Source Code:
(back to article)
<?php $url = "http://www.w3docs.com"; if (!filter_var($url, FILTER_VALIDATE_URL) === false) { echo "$url is a valid URL"; } else { echo "$url is not a valid URL"; } ?>
Result:
Report an issue