1
I have the following function:
function tirarAcentos($string){
return preg_replace(array("/(á|à|ã|â|ä)/","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|ë)/","/(É|È|Ê|Ë)/","/(í|ì|î|ï)/","/(Í|Ì|Î|Ï)/","/(ó|ò|õ|ô|ö)/","/(Ó|Ò|Õ|Ô|Ö)/","/(ú|ù|û|ü)/","/(Ú|Ù|Û|Ü)/","/(ñ)/","/(Ñ)/","/(Ç)/","/(ç)/","/(Ã)/"),explode(" ","a A e E i I o O u U n N C c A"),$string);
}
However, when trying to remove an accent from the "GPA - SUGAR LOAF GROUP" I can’t remove the A specifically, I’ve tried everything and I can’t remove it.
How can I remove?
Follows the application:
session_register("SESSION");
header("Cache-Control: no-cache");
include('Connect.php');
include('conf.php');
include('sec.php');
$v_conexao = new MySQL($vstr_usuario,$vstr_pass,$vstr_host,$vstr_db) or die ("Can't connect with the database");
$vint_conexao=$v_conexao->Get_Connection_ID();
$ssql = "SELECT nome FROM ang_cliente ORDER BY nome ASC";
$vint_result=$v_conexao->Open_Query($vint_conexao,$ssql);
while($v_a=$v_conexao->Fetch_Into($vint_result)){
$nome_removido = tirarAcentos($v_a['nome']);
echo "Nome Atual: ".$v_a['nome']."<br>";
echo "Nome Atualizado: ".$nome_removido."<br>";
echo "<hr>";
}
Look at this http://answall.com/a/33047/15089
– Inkeliz
I’ve tried that way @Inkeliz but it doesn’t work :(
– Sr. André Baill
It may be that the connection Encode is different from the file (php)
– rray