Re: Re: What would the best way to veladate a URL string?
| From: | Philip J. Newman | Date: | Sun, 14 Dec 2003 03:04:34 +0000 |
| Subject: | Re: Re: What would the best way to veladate a URL string? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172659@lists.php.net to get a copy of this message | ||
Hay that works better thanks
----- Original Message -----
From: "Paul Chvostek" <paul+php@it.ca>
To: <php-general@lists.php.net>
Sent: Sunday, December 14, 2003 2:17 PM
Subject: [PHP] Re: What would the best way to veladate a URL string?
> On Sun, Dec 14, 2003 at 11:23:25AM +1300, Philip J. Newman wrote:
> >
> > What would the best way to veladate a URL string?
>
> Validate? How about something like:
>
>
eregi('^(f|ht)tp://([a-z0-9._:-]+@)?([a-z0-9][a-z0-9-]+\.)+[a-z][a-z]+(/([a-z0-9.%&=-]+)?)?',$string
);
>
> You can adjust the "get" part to suit...
>
> --
> Paul Chvostek <paul@it.ca>
> it.canada
> http://www.it.ca/
> Free PHP web hosting!
> http://www.it.ca/web/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>