Opa...
You can do this in many ways...
You can set it in PHP itself by placing it at the beginning of the document
<?php header("Content-type: text/html; charset=utf-8"); ?>
You can speed up the output of data directly from the Mysql:
mysql_set_charset('utf8');
PDO:
$handle = new PDO("mysql:host=localhost;dbname=nomebanco",
'usuario', 'senha',
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
In case the problem is only happening with the HTML, is resolved simply by setting the UTF of the page, or the UTF-8 or the code ISO-8859-1...
It can also do the hard way, with the str_replace:
$string="Téstè! Hasta Mañana!";
function retiraAcentos($string){
return preg_replace(array("/(á|à|ã|â|ä)/","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|`ë)/","/(É|È|Ê|Ë)/","/(í|ì|î|ï)/","/(Í|Ì|Î|Ï)/","/(ó|ò|õ|ô|ö)/","/(Ó|Ò|Õ|Ô|Ö)/","/(ú|ù|û|ü)/","/(Ú|Ù|Û|Ü)/","/(ñ)/","/(Ñ)/"),explode(" ","a A e E i I o O u U n N"),$string);
}`
echo retiraAcentos($string);
I hope I’ve helped in some way :)
Both bank and website are UTF-8.
– Max