Use filter_var instead of parse_url to validate URLs, since the latter r...

...eturns true even for invalid URLs, in particular the empty string