-
-
Save infoshahin/7aaa808674d944d408242edff0ba4cc1 to your computer and use it in GitHub Desktop.
convertUTF8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function convertUTF8($string) | |
{ | |
//$sampleString = 'u0986u09a8u09c7u09beu09dfu09beu09b0 u09b9u09c7u09beu09b8u09beu0987u09a8'; | |
$string = preg_replace('/u([0-9a-fA-F]+)/', '&#x$1;', $string); | |
return html_entity_decode($string, ENT_COMPAT, 'UTF-8'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment