It doesn't necessarily have to be PHP but, basically I'm looking to create a script that has a pre-set list of strings and compares that list to other specified lists of strings and determines which ones match. Any ideas?
You know what let me completely rephrase this question. I need a script that will take a textarea, and map each line of the text area to an array. So for example if we have a textarea that looks like this: red blue green black yellow it will make "red" the first value in the array, "blue" the second value and so on...
I'm not sure that your explanation is clear enough, but according to your explanation it's enough to explode textarea variable: $arr = explode("\n", @$_POST["lines"]); // $arr will contain textarea values splitted in array elements line by line PHP:
Maybe you should trim() the values as well, to remove possible carriage return characters. $arr = explode("\n", @$_POST["lines"]); $arr = array_filter(array_map('trim', $arr)); PHP: