This is the function which will validate url:
PHP Code:
function isValidURL($url)
{
return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
}
Use of function :
PHP Code:
if(!isValidURL($fldbanner_url))
{
$errMsg .= "* Please enter valid URL including http://
";
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment