- var_dump: documentation ( source)
- mb_detect_encoding: documentation ( source)
- htmlentities: documentation ( source)
<?php
class Test{
function __construct(){
$this->page="Test<br/>Test hého";
}
function text(){
echo "\n START\n";
var_dump(mb_detect_encoding($this->page));
var_dump($this->page);
echo "\n 1: ";
var_dump(mb_detect_encoding($this->page));
var_dump(strlen($this->page));
$temp=htmlentities($this->page, ENT_IGNORE, 'UTF-8');
echo "\n 2: ";
var_dump(mb_detect_encoding($temp));
var_dump(strlen($this->page));
echo "\n 3: ";
var_dump(mb_detect_encoding($this->page));
var_dump($this->page);
}
}
$a=new Test();
$a->text();
?>