November 13, 2011 in PHP, Programming, Tutorials by admin

Validating url hyperlinks has been made easy with PHP and its filter validations. Here is a very easy way to validate website urls using PHP.

PHP
1
2
3
4
5
6
7
<?php
$url = 'http://www.creativearmory.com';
if (filter_var($url, FILTER_VALIDATE_URL)) {
echo "This url is valid";
}
?>