- var_dump: documentation ( source)
- bin2hex: documentation ( source)
- htmlspecialchars: documentation ( source)
- html_entity_decode: documentation ( source)
<?php
var_dump( bin2hex( html_entity_decode( htmlspecialchars( "\xc0\x80", ENT_NOQUOTES, 'UTF-8' ) ) ) );
var_dump( bin2hex( html_entity_decode( htmlspecialchars( "\xc2", ENT_NOQUOTES, 'UTF-8' ) ) ) );
var_dump( bin2hex( html_entity_decode( htmlspecialchars( "\xe0\x80\x80", ENT_NOQUOTES, 'UTF-8' ) ) ) );
var_dump( bin2hex( html_entity_decode( htmlspecialchars( "\xf4\x90\x80\x80", ENT_NOQUOTES, 'UTF-8' ) ) ) );