I have the following code :
$stopwords = file("/path/to/my-file.txt", FILE_IGNORE_NEW_LINES);
echo($stopwords[0]." - ");
$words = explode(" ", "alors on danse");
echo($words[0]." - ");
if (in_array($words[0], $stopwords)) {
echo("yay");
} else {
echo("nay");
}
And I always get alors - alors - nay
as a result, when I'm expecting alors - alors - yay
I've seen a few topics on here regarding similar problems and the solutions were almost always to use the trim() function on the elements of the list array. Which I tried, but it didn't change anything.
Could you please help me realize what I'm doing wrong ?