- var_dump: documentation ( source)
- htmlspecialchars: documentation ( source)
- html_entity_decode: documentation ( source)
<?php
$text = 1;
var_dump(html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
var_dump(htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'));