if each value in the textfile is separated from the others by <enter>, means new-line you might go this way.
read the values from the text file:
$file = "yourtextfile.txt";
// open textfile for reading
$fp = fopen($file, "r");
$i = 0;
while(!feof($fp)){
// read lines from textfile, up to 255 characters in each line
$row = fgets($fp, 255);
// delete newline-command from end
$valuesFromTextfile[$i] = str_replace("\n", "", $row);
$i++;
}
fclose($fp);
now you'll have the array $valuesFromTextfile.
the easiest comparison is done by in_array().
if you want to know if a value is in the array this will do:
if(in_array($lookFor, $valuesFromTextfile)) echo "Value found.<br />";
else echo "Value NOT found.<br />";
if you want to know where the value is (position in the array) you might use array_search($needle, $haystack), which will return the key of the array...
hope i am not writing rubbish here, a new day already starts in krautland and i missed ending the previous one...
good luck. 😉