| ||||||||||||
| ||||||||||||
String searching Posted by mitch2301 (mitch2301), 2 June 2006 I am working on a data validation class which checks length and formats of inputs (such as numerical, alphabetical input etc)I have the following array with some event handlers in it: Code:
The class also contains this variable: Code:
It contains the data which is going to be checked in the class. I am trying to find a function which will check the string against the array to see if the string contains any event handlers. Initially the class removed the event handlers straight off but I have decided I would like to record the input in a table in the database THEN remove the event handlers. It's basically so I can have a table containing the original bad input while removing the event handlers and letting the class remove them and continue running. Basically I want something which does the following: Code:
I hope someone here can help me. I get the feeling its one of those basic functions I really should know but don't ![]() Posted by admin (Graham Ellis), 2 June 2006 How's this?Code:
Posted by mitch2301 (mitch2301), 2 June 2006 It work to get the basic part of what I want done (two different strings) but I still need some sort of logic to it because I don't want to record every bit of input in the table.If this is any help; I was thinking of a function like in_array() only I need one for checking strings rather than arrays. Even if it was something like: Code:
Posted by mitch2301 (mitch2301), 2 June 2006 Ah, I got it.in_array works for it too. Thanks for the help ![]() This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| |||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |