|
A primitive url validator.
<?php
function isUrl($url)
{
$info = parse_url($url);
return ($info['scheme']=='http'||$info['scheme']=='https')&&$info['host']!="";
}
?>
Sign up to add your own comment here!
Comments
|
|
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
|
|