Error with tildes PHP [duplicated]

0

Good day, when sending data from javascript work and send the tildes perfectly but at the time of printing on php comes something like this:

Original Text : éstá és úná prúébá de tildes
PHP Text : ?st? ?s ?n? pr??b? de tildes

Even coding is lost to recognize vowels that carry accents; I have already tried several ways but none works. I would appreciate help from you.

    
asked by Andres Galeano 06.06.2018 в 16:45
source

1 answer

1

It seems to be a charset problem in PHP. Try the following using header :

header('Content-Type: text/html; charset=utf-8');

You should also check from the client side, html, that you have the same charset set.

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    
answered by 06.06.2018 в 16:52