- var_dump: documentation ( source)
- utf8_encode: documentation ( source)
- mb_internal_encoding: documentation ( source)
- mb_http_output: documentation ( source)
<?php
// Tell PHP that we're using UTF-8 strings until the end of the script
mb_internal_encoding('UTF-8');
// Tell PHP that we'll be outputting UTF-8 to the browser
mb_http_output('UTF-8');
// Our UTF-8 test string
$string = 'Êl síla erin lû e-govaned vîn.';
$decoded_stuff = utf8_encode("Müller");
var_dump($decoded_stuff);
$string2 = utf8_encode($string);
var_dump($string2 );
?><!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>UTF-8 test page</title>
</head>
<body>
<?php
foreach($result as $row){
print($row->Body); // This should correctly output our transformed UTF-8 string to the browser
}
?>
</body>
</html>