Check for values in an array
Moderator: General Moderators
Check for values in an array
With my current setup, I have a series of numbers stored in an array, and I want to create an IF statement that will return a statement if my variable is contained within that array string. ie if my array is "1,2,3,4,5", then I want to have "True" returned if "3" is the value being compared against the string. What function can I use to get this result? Thanks.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Jcart 1, Feyd 24323feyd wrote:in_array()