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. 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. 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(). 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
Archived
This topic is now archived and is closed to further replies.