Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1027

can I get the unicode value of a character or vise versa with php?

$
0
0

Is it possible to input a character and get the unicode value back? for example, i can put &#12103 in html to output "⽇", is it possible to give that character as an argument to a function and get the number as an output without building a unicode table?

$val = someFunction("⽇");//returns 12103

or the reverse?

$val2 = someOtherFunction(12103);//returns "⽇"

I would like to be able to output the actual characters to the page not the codes, and I would also like to be able to get the code from the character if possible.The closest I got to what I want is php.net/manual/en/function.mb-decode-numericentity.php but I cant get it working, is this the code I need or am I on the wrong track?


Viewing all articles
Browse latest Browse all 1027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>