Re: Php filter validate url
| From: | Shawn McKenzie | Date: | Sun, 26 Jun 2011 19:01:27 +0000 |
| Subject: | Re: Php filter validate url | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-313727@lists.php.net to get a copy of this message | ||
On 06/26/2011 12:31 PM, Adam Tong wrote:
> 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
No, because http:// is not a URL, it's a scheme or protocol.
--
Thanks!
-Shawn
http://www.spidean.com