Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. public static function convertUTF8($string)
  2. {
  3. //$sampleString = 'u0986u09a8u09c7u09beu09dfu09beu09b0 u09b9u09c7u09beu09b8u09beu0987u09a8';
  4. $string = preg_replace('/u([0-9a-fA-F]+)/', '&#x$1;', $string);
  5. return html_entity_decode($string, ENT_COMPAT, 'UTF-8');
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement