"convert any string or a character in php to unicode code points" Code Answer

4

use this function

function unicode_decode($text) {
     return implode(unpack('h*', iconv("utf-8", "ucs-4be", $text)));
 }

if you want to have u+0000 use this :

for ($i=0; $i < strlen($word); $i++)
{
    $wordconvert = unicode_decode($word[$i]);
    $result .= "u+" . substr($wordconvert, -4, 4) . "<br/>";

}

echo $result; 
By musicnothing on March 9 2022

Answers related to “convert any string or a character in php to unicode code points”

Only authorized users can answer the Search term. Please sign in first, or register a free account.