severndigital Posted August 14, 2007 Share Posted August 14, 2007 ok I have an array $salt = array('A','C','D','F','P','N'); and I have a value $var = 'Z'; The example is in Letters because the vars I will be matching are letters. I want to check it against the array and see if it matches any of the values. I could write a long ifelse() statment but i was hoping to do in 2 or 3 lines instead. In knowing that that array may change in the future. any ideas?? thanks, chris Quote Link to comment Share on other sites More sharing options...
Orio Posted August 14, 2007 Share Posted August 14, 2007 Use in_array() Orio Quote Link to comment Share on other sites More sharing options...
severndigital Posted August 14, 2007 Author Share Posted August 14, 2007 thanks, I searched php.net for 30mins and came up empty.. thanks again, chris Quote Link to comment 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.