Commit 6486fd81f697ca68a54dc1a0f334ca7877f737fa
1 parent
c8397f9b
Exists in
master
and in
7 other branches
Incluida função de remoção de acentos
Showing
1 changed file
with
27 additions
and
0 deletions
Show diff stats
classesphp/funcoes_gerais.php
... | ... | @@ -2008,4 +2008,31 @@ function autoClasses(&$nlayer,$mapa) |
2008 | 2008 | if($substituicon == "sim"){$nlayer->set("connection"," ");} |
2009 | 2009 | return; |
2010 | 2010 | } |
2011 | +/* | |
2012 | +Function: removeAcentos | |
2013 | + | |
2014 | +Remove os acentos de uma string | |
2015 | + | |
2016 | +Parameters: | |
2017 | + | |
2018 | +var - string | |
2019 | + | |
2020 | +Return: | |
2021 | + | |
2022 | +palavra sem acento | |
2023 | +*/ | |
2024 | +function removeAcentos($var) | |
2025 | +{ | |
2026 | + $var = ereg_replace("[ÁÀÂÃ]","A",$var); | |
2027 | + $var = ereg_replace("[áàâãª]","a",$var); | |
2028 | + $var = ereg_replace("[ÉÈÊ]","E",$var); | |
2029 | + $var = ereg_replace("[éèê]","e",$var); | |
2030 | + $var = ereg_replace("[ÓÒÔÕ]","O",$var); | |
2031 | + $var = ereg_replace("[óòôõº]","o",$var); | |
2032 | + $var = ereg_replace("[ÚÙÛ]","U",$var); | |
2033 | + $var = ereg_replace("[úùû]","u",$var); | |
2034 | + $var = str_replace("Ç","C",$var); | |
2035 | + $var = str_replace("ç","c",$var); | |
2036 | + return $var; | |
2037 | +} | |
2011 | 2038 | ?> |
2012 | 2039 | \ No newline at end of file | ... | ... |