Since your output is probably HTML, displayed in a browser window, you can use this wonderful (but sometimes hard-to-spell 😉 function called htmlentities:
<? $question = htmlentities("téléphone");
echo $question; ?>
I always use this when outputting string variables that I do not have complete control over.
Sylvie wrote:
HI!
I just install a macosX sever. I use php and mysql.
I have a problem with the accents when I use php.
Example:
<? $question = "téléphone";
echo $question; ?>
The echo return me weird characters because of the "é". I try to use utf8_encode but it dosen't work can somebody help me!
Thank!