function trim_value(&$value)
{
$value = trim($value);
}
$text = file($pathishod.$val); // the message itself
$result = file('result.txt');
array_walk($text, 'trim_value'); // first array, remove spaces
array_walk($result, 'trim_value'); // second array, removed the spaces
$ick = $text[3];
if(in_array($ick, $result, true) == true){
echo "found";
}
$ick = "Subject: Re: Order No. 17938";
[39] =>
string(42) "9063. 07.04.2014 - Order No. 17938.txt"
[40] =>
string(60) "From: "name" <926*******@mail.ru>"
[41] =>
string(25) "Date: 07.04.2014 13:14:18"
[42] =>
string(32) "Subject: Re: Order No. 17938"
$ick = $text[3];
if(in_array($ick, $result, true) == true){
echo "found";
}
$ick = $text[3];
var_dump($ick);
if(in_array($ick, $result, true)){ //as for the third argument are you sure? if you check only the lines, why so strict ?
echo "found";
}
Find more questions by tags PHP