cyril260 Smarty n00b
Joined: 10 May 2022 Posts: 1
|
Posted: Tue May 10, 2022 8:42 pm Post subject: New function to replace accents |
|
|
Hello,
this is my first smarty function in order to replace accents.
I have created a new file called "modifier.min.php" which is located in "smarty/plugin" folder
Below is the code that I have used:
Code: |
function smarty_modifier_min($string)
{
$search = array("ï","î","ç","â","à","é","è","ê","ô","û","Â","À","É","È","Ê","Ô","Û","Î","Ï","'","’");
$replace = array("i","i","c","a","a","e","e","e","o","u","A","A","E","E","E","O","U","I","I"," "," ");
$string= str_replace($search, $replace, $string);
return $string;
}
|
Then I have added to a template file the following code :
Code: | {$address['address1']|min} |
And the accents are still there in the variable.
Could someone please tell me what did I do wrong ?
Thank you very much for your help
Best regards
Cyril |
|