onlyican Posted June 14, 2007 Share Posted June 14, 2007 I am kicking myself at this, I used to be able to do it, now I can't remember how. I been working too hard I think. Anyway This site i build has floor plans and the user can label each seat. I need to check each seat ID to make sure it does not contain any illegal chars What I want to be able to do is have something like $IllegalChars = "-_%|"; Then a script which will check each value from the array to check nothing contains one of my illegal chars foreach($MyArray as $value){ // CODE HELP } Quote Link to comment https://forums.phpfreaks.com/topic/55545-forgotten-how/ Share on other sites More sharing options...
joshi_v Posted June 14, 2007 Share Posted June 14, 2007 I think this will work for u foreach($MyArray as $value){ if(ereg($IllegalChars , $value) { //code } else { //Code } } Quote Link to comment https://forums.phpfreaks.com/topic/55545-forgotten-how/#findComment-274462 Share on other sites More sharing options...
onlyican Posted June 14, 2007 Author Share Posted June 14, 2007 I knew it was as simple as a function. Cheers hombre. Quote Link to comment https://forums.phpfreaks.com/topic/55545-forgotten-how/#findComment-274470 Share on other sites More sharing options...
onlyican Posted June 14, 2007 Author Share Posted June 14, 2007 Thanks, but Ereg is not correct for this format. Quote Link to comment https://forums.phpfreaks.com/topic/55545-forgotten-how/#findComment-274478 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.