0
Ola could help me where exactly put the delimiters in the code below?
function simplifica($txt){
$txt = strtolower($txt);
$txt = str_replace(array('á','à','â','ã','å','ä','ª','Á','À','Â','Ã','Ä'), 'a', $txt);
$txt = str_replace(array('é','è','ê','ë','É','È','Ê','Ë'), 'e', $txt);
$txt = str_replace(array('í','ì','î','ï','Í','Ì','Î','Ï'), 'i', $txt);
$txt = str_replace(array('ó','ò','ô','õ','ö','º','Ó','Ò','Ô','Õ','Ö'), 'o', $txt);
$txt = str_replace(array('ú','ù','û','ü','Ú','Ù','Û','Ü'), 'u', $txt);
$txt = str_replace(array('ñ','Ñ'), 'n', $txt);
$txt = str_replace(array('ç','Ç'), 'c', $txt);
/*
$txt = ereg_replace('[áàâãåäªÁÀÂÄÃ]', 'a', $txt);
$txt = ereg_replace('[íìîïÍÌÎÏ]', 'i', $txt);
$txt = ereg_replace('[éèêëÉÈÊË]', 'e', $txt);
$txt = ereg_replace('[óòôõöºÓÒÔÕÖ]', 'o', $txt);
$txt = ereg_replace('[úùûüÚÙÛÜ]', 'u', $txt);
$txt = ereg_replace('[ñÑ]', 'n', $txt);
$txt = ereg_replace('[çÇ]', 'c', $txt);
*/
$txt = preg_replace("\n|\t|\r", '', $txt);
$txt = preg_replace('[ ]+', ' ', $txt); // de 2 espaços p/ nada
$txt = preg_replace('[ ]', '-', $txt); // de 2 espaços p/ nada (denovo)
$txt = preg_replace('-+', '-', $txt); // de 2 espaços p/ nada (denovo)
return preg_replace('/([^a-z0-9-]*)/', '', $txt);
What is the input (initial value of
$txt
) and the expected result?– danguilherme
edit it, I put the full function ! , I get the error : Str: preg_replace(): Unknown Modifier
– user22753
the expected result is to correct the backend of a ready site system ! http://demo.sisfacil.com.br/
– user22753
migrated php5.2 server to 5.4 , then suffering a lot since then to correct so many errors
– user22753
Do you know which line the error is on? Have a stack trace?
– danguilherme