How to make a PHP script display the correct characters

In short, the problem is that your script doesn’t display the retrieved data correctly. For example, they are replaced by question marks, ?.

Putting this line of code at the beginning of your script might solve your problem:

header("Content-Type: text/html; charset=iso-8859-1");

Of course you’ll have to change the charset value to match your needs.  Furthermore this might not be enough, you might also have to change the charset of the system your web application run into.
I hope this helps!

This entry was posted in IT, Programming and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

2,103 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>