How to enable UTF-8 and Latin Charatersets in PHP and MySQL

I can view the UT8 characters correctly in phpMyAdmin. The data is stored correctly in the MySQL db.

However, when I call the data on a php page, php displays a? instead of the characters from the db.

This solved it for me.

mysql_query(SET NAMES utf8);
after mysql connection.

or Try this

<!-- xml version="1.0" encoding="UTF-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<?php echo $utf8variable;?>

Handing Character Encoding in PHP Applications