Php filter validate url
| From: | Adam Tong | Date: | Sun, 26 Jun 2011 17:31:30 +0000 |
| Subject: | Php filter validate url | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-313726@lists.php.net to get a copy of this message | ||
Hi,
I wanted tu use php filters for validation to avoid regular expresions.
Is it possible that FILTER_VALIDATE_URL only checks if the string has
http:// and do not check for the format domain.something?
----
$url = 'http://wwwtestcom';
$url = filter_var($url,FILTER_VALIDATE_URL);
echo $url;
-----
Or I am doing something wrong
Thank you