I have a text file that contains safe words. I want to be able to check user inputs which arrive as large strings (50-100 words) to make sure that they only contain safe words. I am wondering what is the right approach to do this in PHP.
The only approach I have in mind is looping through user's response word by word and compare against the list of safe words. This approach, unfortunately, leads to memory size issues!
The file that contains the safe words has well over 700K words.