Is it possible to input a character and get the unicode value back? for example, i can put ⽇ in html to output \"⽇\", is it possible to give that character as an a
Here's a more compact implementation of unichr/uniord based on pack:
// code point to UTF-8 string
function unichr($i) {
return iconv('UCS-4LE', 'UTF-8', pack('V', $i));
}
// UTF-8 string to code point
function uniord($s) {
return unpack('V', iconv('UTF-8', 'UCS-4LE', $s))[1];
}