Search found 1 match

by pauper2thedemon
Tue Aug 10, 2010 8:06 am
Forum: Regex
Topic: Hard/Easy Regular Expression help
Replies: 2
Views: 5248

Re: Hard/Easy Regular Expression help

I would use filter_var personally

http://www.php.net/manual/en/book.filter.php

Code: Select all

<?php

$url = 'http://www.some-example.com/url/here';
$url = filter_var( $url, FILTER_VALIDATE_URL );

if( $url === FALSE ){
   echo 'url is not valid';
}