mme Posted January 15, 2011 Share Posted January 15, 2011 Hi, I am trying to see if the domain name in the string is in an array. eg; mystring='http://google.com/somethingelse'; myarray[]='google.com'; myarray[]='anotherdomain.com'; in this case return TRUE mystring='http://phpfreaks.com/adir'; myarray[]='google.com'; myarray[]='anotherdomain.com'; in this case return FALSE How would I do this? Thanks, -mme Quote Link to comment https://forums.phpfreaks.com/topic/224515-domain-name-check/ Share on other sites More sharing options...
cmattoon Posted January 15, 2011 Share Posted January 15, 2011 Try using regex. This site has a few examples on URL regexes. I'm still not very good with them though. Quote Link to comment https://forums.phpfreaks.com/topic/224515-domain-name-check/#findComment-1159825 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.