WesleyA Posted March 21, 2016 Share Posted March 21, 2016 How should I validate 'wrong' or 'fake' protocols? Not sure how to explain this. I mean type mismatches like gttps : // but also random chars like qwerty : // should be validated. So chars before : // ( placed spaces in the protocols above else I wasnt possible to post it here) How to do this with regex php? Link to comment Share on other sites More sharing options...
justsomeguy Posted March 21, 2016 Share Posted March 21, 2016 I don't think you need a regular expression for that. You can use things like substr and strpos to get the text before the colon, and compare that with a list of known protocols. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now