I want to check if a value exists in an array made from a text file. This is what I've got so far:
<?php
$array = file($_SERVER['DOCUMENT_ROOT'].'/textfile.txt');
if(in_array('value',$array)){
echo 'value exists';
}
?>
I've experimented a little with foreach-loops as well, but couldn't find a way to do what I want.. The values in the text document are separated by new lines.