- mb_convert_encoding: documentation ( source)
- var_dump: documentation ( source)
- mb_check_encoding: documentation ( source)
- utf8_encode: documentation ( source)
<?php
$output = "test";
if(!mb_check_encoding($output, 'UTF-8')) {
if(mb_check_encoding($output, 'ISO-8859-1')) {
$output = utf8_encode($output);
} else {
$output = mb_convert_encoding($content, 'UTF-8');
}
}
var_dump($output);