What about the in_array(); function?
<?php
$file = 'foo.jpg';
$file_arr = file('dir/subdir/file.txt');
if(in_array($file, $file_arr)) {
echo 'Found!';
}
else {
echo 'Not found';
}
?>
Something smiliar to that.
EDIT
Okay, I wasn't able to get the above to work (maybe because there's a new-line appended to each array element in $file_arr), but this should work.
<?php
$file = 'foo.jpg';
$file_arr = file('files.txt');
foreach($file_arr as $the_file) {
if(trim($the_file) === $file) {
echo 'Found!';
break;
}
else {
echo 'Not found';
break;
}
}
?>