[php] Best way to check if a URL is valid