RSS
Home
|
Link Us
|
Contact
Categories
-- All --
Perl
PHP
MySQL
Windows
JavaScript
HTML
Apache
CVS
Linux
SEO
Perl (9)
PHP (35)
MySQL (5)
Windows (7)
JavaScript (5)
HTML (6)
Apache (6)
CVS (4)
Linux (13)
SEO (11)
The registration is temporarily disabled.
However you can post your comments without registration.
Authentication
Username:
Password:
Register
|
Lost password
-->
Validate URL (FTP, HTTP) using regular expression ( regex )
Home
»
PHP
»
Validate URL (FTP, HTTP) using regular expression ( regex )
Date: 2005-08-09
Validate URL (FTP, HTTP) using regular expression ( regex )
Download
|
Printer Friendly
Add to Google
Add to Del.icio.us
Add to Digg
Add to Technorati
Add to Yahoo!
Add to Blinklist
Add to Furl
Add to reddit
* */ function valid_url( $url ) { if ( !preg_match( '!^((ht|f)tps?://)?[a-zA-Z]{1}([w-]+.)+([w]{2,5})/?$!i', $url ) ) { return false; } else { return true; } } if ( valid_url( "http://devquickref.com" ) ) { echo "URL OK"; } else { echo "Invalid URL."; } ?>
Comments
author: Anonymous date: 2008-07-09 14:12:39
title: Re: Validate URL (FTP, HTTP) using regular expression ( regex )
this doesnt work
Post a comment
Your Name
Your Email
(won't be published)
Site
(e.g. http://)
*
Title
*
Comment
*
Required fields.
Copyright © 2005-2008
Execution time: 0.03703
hosted by
1and1