The get_html_translation_table() function returns the internal translation table used by htmlspecialchars() and htmlentities(). It is fully supported in PHP 8.5 with no breaking changes to its core behaviour.
Example
<?php
// Get the full HTML5 entity table
$table = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES | ENT_HTML5);// Use it to manually encode a string
$string = "Hello & <World>";
$encoded = strtr($string, $table);echo $encoded;
// Output: Hello & <World>
?>
Summary
Use get_html_translation_table() when you need the raw mapping array for custom encoding logic. For direct encoding, simply use htmlspecialchars() or htmlentities().