I've searched for a while so hopefully this is not a question that is asked many times already.
I'm trying to program on php a script that would remove stop words from a string, and then explode it in an array of words. The stop words could be in English or French.
Currently the following is not working for me as it doesn't remove French characters:
$needles=array(
'/\bil\b/i',
'/\bla\b/i',
'/\ble\b/i',
'/\b'. htmlentities('à') .'\b/i'
);
print_r($needles);
$result=preg_replace($needles, "", htmlentities("il y à trois personne dans la salle à manger"));
print_r($result);
The output removes everything but not the french character: à