Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP: check url is a valid url

if(!$url || !is_string($url) || ! preg_match('/^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$/i', $url)){
    return false;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #url #valid #url
ADD COMMENT
Topic
Name
4+2 =