Validate URL with PHP -


this question has answer here:

i need check if form field valid url (it can done through html5, not every browser has yet), , can't find url checker function. it's strange, because email-checking, there lots of already-done functions.

i've seen (i discovered it) filter_var() function, read, there issues urls. can find regular expressions, don't seem exhaustive.

do know url checker function?

it's because url format can versatile :

http// optionnal www optionnal .com, .net, .us, etc many possible pattern .html, /, .php, or nothing possible ends 

rather using pre-made function, i'd recommend build own function depending on how of users send url, ending etc ...

my 2 cents.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -