With this function I can validate numbers and letters but I need to pass them the accents, the "ñ" and comma "," and blank spaces. PHP
I would like something like this:
$str = 'Caballeros Díaz, Caballeros Bilingüe';
$result= preg_replace('/[^A-Za-z0-9\-]/', '', $str);
//echo $result;
CaballerosDazCaballerosBilinge
allow this ñ áéíóú " , " numbers (spanish letters)