Forum Moderators: coopster
I use to use it alot way, way back when. It had a function called (if I'm remembering correctly) Is Within, where you could pass the function stringA and stringB and it would see if stringA was found "within" stirngB.
I know I could do the same with an array and a while loop but wanted to know if there was already an internal function for such needs.
I've searched php.net's function list and, while it came up with a lot of string-related functions, nothing that I could see matched what I need.
All I want to do is pass a single variable (which might contain, say, "4") which would then be compared against and a string of comma-delimited ints (i.e.: 3,4,7,9,4). If the number passed was found in the list of ints, it would simply return TRUE; if not FALSE.
So, is there a prebuilt function like this one?
Thanks.
Neophyte
notice the!== - not!= - checks for type as well as value, which you need with $strpos.
I like the array idea of the poster above better though.
My wife, however, has been hollering at me to come to dinner for the past hour ("You're always at the <snipped> computer!") so I better let this go right now before she gets the shotgun.
I'll let you guys know if it worked for me tomorrow.
Neophyte
[edited by: coopster at 12:35 pm (utc) on Sep. 13, 2004]
[edit reason] Language TOS 3, 14 [webmasterworld.com] [/edit]