Problem with accented strings

1

I'm getting a string in an AJAX, but if that string has an accent it does not 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 it does not identify that the string is equal.

    
asked by anonymous 05.06.2018 / 16:13

0 answers