- htmlentities: documentation ( source)
- html_entity_decode: documentation ( source)
<?php
$str = 'Text:Š:Тест';
echo $str . PHP_EOL;
$str = html_entity_decode( $str, 0, 'utf-8' );
echo $str . PHP_EOL;
echo htmlentities( $str, 0, 'utf-8' ) . PHP_EOL;