- var_dump: documentation ( source)
- htmlentities: documentation ( source)
- html_entity_decode: documentation ( source)
<?php
$str = "a\x80b";
$encoded = htmlentities($str, ENT_QUOTES, "UTF-8");
$decoded = html_entity_decode($encoded, ENT_QUOTES, "UTF-8");
var_dump($str);
var_dump($decoded);
var_dump($str === $decoded);