note 54571 added to function.str-replace
| From: | estereofonico at gmail dot com | Date: | Fri, 08 Jul 2005 03:45:14 +0000 |
| Subject: | note 54571 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91625@lists.php.net to get a copy of this message | ||
Si alguna vez necesita reemplazar las tildes de un párrafo esta función le puede ser muy útil.
$texto = "Ésta es una bellísima canción de amor de añoranza";
function tildes ($texto) {
global $texto;
$vowels = array("á", "é", "í", "ó",
"ú","ñ","Á", "É", "Í", "Ó",
"Ú", "Ñ");
$rep = array ("á", "é", "í",
"ó",
"ú","ñ","Á",
"É", "Í", "Ó",
"Ú", "Ñ");
return str_replace($vowels, $rep, "$texto");
} // end func
Estereofonica EU
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54571
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54571&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54571&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54571&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54571&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54571&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54571&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54571&report=yes
Search -- http://master.php.net/manage/user-notes.php