1
I’m getting a string in an AJAX, however, if that string have an accent it doesn’t work as it should.
$texto = $_REQUEST['texto_de'];
$texto_escrito = 'AB Construções e Serviços';
if($texto == $texto_escrito){
echo "igual";
}
I am running the following AJAX in the browser:
http://urlajax.com?texto_de=AB Construções e Serviços
This is causing me problems, because later on in the code I need to run a preg_replace
, but he does not identify that the string is equal.
Already made a
var_dump($texto)
to see what’s in PHP?– Woss
var_dump($text); //returned string(34) "AB Constructions and Services" var_dump($texto_written); //returned string(31) "AB Constructions and Services"
– Juliano
I realized that the problem only happens when I copy and paste the source html text of ajax.
– Juliano
When it is the application that runs the ajax it ends up not working, knows some way to standardize everything?
– Juliano