tqla Posted March 30, 2010 Share Posted March 30, 2010 What function can I use to see if a variable contains certain info. For example, I want to check the email field in a form and identify those with "@yahoo.com" in them. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/196927-what-function-can-i-use-to-see-if-a-variable-contains-certain-info/ Share on other sites More sharing options...
premiso Posted March 30, 2010 Share Posted March 30, 2010 if (strstr($email, '@yahoo.com')) { echo "Yep, @yahoo.com email."; } strstr you may also want to take notice of all the string functions at the manual. Quote Link to comment https://forums.phpfreaks.com/topic/196927-what-function-can-i-use-to-see-if-a-variable-contains-certain-info/#findComment-1033872 Share on other sites More sharing options...
tqla Posted March 30, 2010 Author Share Posted March 30, 2010 Thank you! I will use stristr(). Quote Link to comment https://forums.phpfreaks.com/topic/196927-what-function-can-i-use-to-see-if-a-variable-contains-certain-info/#findComment-1033874 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.