Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- приобр&
- оставка
- function Unicode2Charset($string, $charset = 'UTF-8') {
- $string = html_entity_decode($string, ENT_NOQUOTES, $charset);
- return preg_replace(
- '~&#(?:x([da-f]+)|(d+));~ie',
- 'iconv("UTF-16LE", $charset, pack("v", "$1" ? hexdec("$1") : "$2"))',
- $string
- );
- }
- $string = 'приобр&';
- echo Unicode2Charset($string); // OutPut приобр&
- <?php
- echo html_entity_decode(
- "приобр",
- ENT_COMPAT,
- "UTF-8"
- );
- ?>
- приобр
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement