First of all you need to store the dictionary somehow. There are a few ways you could do this ranging from a straightforward array to using a database. Probably the most efficient way would be to use some sort of tree structure. The top level nodes which each contain single letters of the alphabet; the second level nodes (up to 26 per first-level node) would contain a single letter which is a possible second letter for a word (so for 'a' there would probably be 26 second-level nodes, for 'q' only one or two), etc. To check a word against the dictionary you just check that the first letter is one of the first-level nodes, the second one of the second-level nodes for that first-level one, etc. That's probably the most efficient way of storing the dictionary for quick searches.
Of course the biggest problem is inputting the dictionary initially....