I am trying to open a file and compare each line to a string to see if they are same or not, but it's not working, here is the code.
$toSearch="moizhusnain@hotmail.com";
$textData=array();
$fla=FALSE;
$file=fopen('text.txt','r') or die('Unable to open file.');
while(!feof($file))
{
$textData[]=fgets($file);
}
fclose($file);
for($i=0;$i<count($textData);$i++)
{
echo $textData[$i]."<br/>";
if (strcmp($toSearch,$textData[$i])==0)
{
echo "Yes";
}
}