In_array not looking for how to find?

Hi all. In_array not looking, began to Google, found a lot of examples and moves, but to no avail.
But when I search string written by hand, this function finds. If using a variable, then no, it is not.
Walked trim all the array values, just in case, then manually put \n and \r\n at the end of the variable, not looking.
Remove the spaces in the array
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

Next, begin to look for
$ick = $text[3];
if(in_array($ick, $result, true) == true){
echo "found";
}

And I can not find.
The function works if I write so directly.
$ick = "Subject: Re: Order No. 17938";
Here's a piece of the array, where you have to find
[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"


Why not looking for what's wrong with her?
July 8th 19 at 16:05
2 answers
July 8th 19 at 16:07
usually if I write such a function, then write them to shorten the name, and you took the trim and extended it to trim_value, TNT? O_O

are you sure you want to use array_walk, but not php.net/manual/en/function.array-walk-recursive.php ? because the var_dump gave you a multidimensional array.

$ick = $text[3];
if(in_array($ick, $result, true) == true){
echo "found";
}


replace
$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";
}
July 8th 19 at 16:09
What does debug $ick = $text[3]; ?

Find more questions by tags PHP