Source Rally PHP Community Scripts .. Sign up .. Login
A primitive url validator.
Access: Public      Tags: url, validation
Add to favourites       Subscribe comments       Copy code       Bookmark
<?php
function isUrl($url)
{
    
$info parse_url($url);
    return (
$info['scheme']=='http'||$info['scheme']=='https')&&$info['host']!="";
}
?>
Add to favourites       Subscribe comments       Copy code       Bookmark
Sign up to add your own comment here!

Comments

neptho - 15-09-2007 00:33
Add to friends       Mail user
This could be summed up as:

<?php
function isUrl($url=FALSE) {
return (@parse_url($url)) ? TRUE : FALSE;
}

However, I'm assuming that you're trying to ferret out ftp:// by your code.
More comments: 1
Shared by:

regin

Mail user Add to friends
All user contributed content is available under the unless specified otherwise.
Remaining copyrights Regin Gaarsmand 2006-2008
About www.SourceRally.net