<?php
function no_accent($str_accent)
{
$pattern = Array("/é/", "/è/", "/ê/", "/ç/", "/à/", "/â/", "/î/", "/ï/", "/ù/", "/ô/");
// notez bien les / avant et après les caractères
$rep_pat = Array("e", "e", "e", "c", "a", "a", "i", "i", "u", "o");
$str_noacc = preg_replace($pattern, $rep_pat, $str_accent);
return $str_noacc;
}
$accent = "Bé alors comment va ta mère ? Où vas tu ? àààhh !!";
echo $accent."<br>";
no_accent ($accent);
echo $str_noacc;
?>
me renvoie Undefined variable: str_noacc in c:\program files\easyphp1-7\www\extranet\back\ressources\accent.php on line 21Ou est le problème ?