12-06-2007, 05:36 PM
|
#19 (permalink)
|
|
The Contributor
Join Date: Oct 2007
Location: Argentina
Posts: 72
Thanks: 18
|
Im glad to see how much this thread is progressing. Devolio, i wouldnt mind either to see you credit TalkPHP
Here is another to validate URLS i made yesterday, it's not perfect at all so maybe we can improve it to make it better:
/^(http|https|ftp):\/\/([\w]*)\.([\w]*)\.(com|net|org|biz|info|mobi|us|cc|bz|tv|ws|name |co|me)(\.[a-z]{1,3})?\z/i
PHP Code:
$szString = "http://www.talkPHP.com"; if (preg_match('/^(http|https|ftp):\/\/([\w]*)\.([\w]*)\.(com|net|org|biz|info|mobi|us|cc|bz|tv|ws|name|co|me)(\.[a-z]{1,3})?\z/i', $szString)) echo "This is a valid URL";
Last edited by Matt83 : 12-09-2007 at 01:31 PM.
|
|
|
|