in reply to checking an array of numbers for a particular value

Anonymous Monk,
This is a FAQ. Additionally, I wrote a tutorial to accompany the FAQ - see Getting Matching Items From An Array. On a final note, if your numbers are in order - a binary search may be appropriate. If many searches are going to need to be performed and the data isn't going to change in between searches, consider using a parallel hash for fast lookups.

Cheers - L~R

  • Comment on Re: checking an array of numbers for a particular value