note 87493 added to function.str-replace

From: Date: Sun, 07 Dec 2008 12:48:58 +0000
Subject: note 87493 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-147782@lists.php.net to get a copy of this message
Substituindo caracteres acentuados em uma string (português) If you need change portugues chars to ansi chars, try this $com_acentos=array( "á","Á","ã","Ã", "â","Â","à","À", "é","É","ê","Ê", "í","Í","ó","Ó", "õ","Õ","ô","Ô", "ú","Ú","ü","Ü", "ç","Ç"); $sem_acentos=array( "a","A","a","A", "a","A","a","A", "e","E","e","E", "i","I","o","O", "o","O","o","O", "u","U","u","U", "c","C"); $input_string = 'Ações em Alta. Série positiva:[áéíóúÁÉÍÓÚçÇ]'; $output_string = str_replace($com_acentos,$sem_acentos,$input_string); echo 'input_string : ' . $input_string . " <br />\n"; echo 'output_string: ' . $output_string . " <br />\n"; ------------------- Your will get: input_string : Ações em Alta. Série positiva:[áéíóúÁÉÍÓÚçÇ] output_string: Acoes em Alta. Serie positiva:[aeiouAEIOUcC] ---- Server IP: 200.185.109.13 Probable Submitter: 189.7.158.120 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/87493 Del: integrated -- https://master.php.net/note/delete/87493/integrated Del: useless -- https://master.php.net/note/delete/87493/useless Del: bad code -- https://master.php.net/note/delete/87493/bad+code Del: spam -- https://master.php.net/note/delete/87493/spam Del: non-english -- https://master.php.net/note/delete/87493/non-english Del: in docs -- https://master.php.net/note/delete/87493/in+docs Del: other reasons-- https://master.php.net/note/delete/87493 Reject -- https://master.php.net/note/reject/87493 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#147782) next »