Originally Posted by mathceleb
Doing the long way, I have the code below. the problem is, that 3-D array contains 6000 entries, and I have to crank through it a few thousand times.
With that many entries being checked that many times, I would strongly suggest using a relational database. If you can't or won't install mysql (or some other sql) server software, you should look at sqlite. It uses a local file to store the database and is almost as fast as other sql implementations.