note 51311 added to function.ereg-replace
| From: | gutodotonideskatgmaildotcom at osu1 dot php dot net | Date: | Sat, 26 Mar 2005 23:38:47 +0000 |
| Subject: | note 51311 added to function.ereg-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87037@lists.php.net to get a copy of this message | ||
hello tere .
I new on php thing, and i want to build a function to remove acentuation on characters.
Don´t laught of this, but i try with the function above
// Guto Ferreira " RemoveAcentuation function"
function RemoveAcentuation($strSearch,$strAcent,$strWord) {
global $strSearch,$strAcent,$strWord;
$Acent = ereg_replace($ $strSearch,$strAcent,$strWord);
switch($Letra){
case "Á","À","Â","Ã","Ä" :
$Letra = "A"; // removing the acentuation
break;
............
............
default:
$strAcent = ereg_replace("'","''",$strSearch);
1srt Question: Can i use this expression for default ???
}
return $strAcent;
// 2nd Question : It the return method OK ???
}
I´m using this function on a script dictionary i´m building
and i use it like this
....sql comands .... ".RemoveAcentuation(str_replace( "'",
"''",$strSearch))."";
third question : the usage of the function on the script is correct or not???
Please help me, i need to use the function on the script .
R:)gards Guto Ferreira
PHP FrEElanceR
[ http://onidesk.sytes.net]
FOUNDER OF THE GROUP PHP-pt TO BEGGINERS AND EXPERTS
knowed on site as:GRUPO PHP-pt PARA AMADORES E EXPERTS
[http://www.hi5.com/ ]
----
Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51311
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51311&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51311&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51311&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51311&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51311&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51311&report=yes
Search -- http://master.php.net/manage/user-notes.php