How to validate URL in php?

Asked

Viewed 448 times

0

How do I validate a php URL? Example: I need the user to type a url, e.g., google.com.

However I need the url to be in the format: www.google.com and if it type any format other than this returns an error for it to fix.

If it types specific pages as well. Example www.google.com/images. I need it to validate only until . br or . with etc...only up to the domain. How do I do?

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.