, , , . @CasimiretHippolyte , , .
, ( ):
function removeAccents($string)
{
return preg_replace('/[\x{0300}-\x{036f}]/u', '', Normalizer::normalize($string, Normalizer::FORM_KD));
}
function addAccents($string)
{
$array1 = array('a', 'c', 'e', 'i' , 'n', 'o', 'u', 'y');
$array2 = array('[aàáâãäå]','[cçćĉċč]','[eèéêë]','[iìíîï]','[nñ]','[oòóôõö]','[uùúûü]','[yýÿ]');
return str_replace($array1, $array2, strtolower($string));
}
$word="something";
$word = preg_quote(trim($word));
$word2 = $this->addAccents($this->removeAccents($word));
if(!empty($word)) {
$sentence = "/(".$word.")|(".$word2.")/ui";
if (preg_match($sentence, $content)){
echo "found";
}
}
Btw, im ( ). , addAccents() .