Get Unicode Code Point of Character using PHP

mbstring extension

  1. Enable extension in php.ini file:
extension=mbstring
  1. Get Unicode code point of character:
<?php

$character = '™';
$code = sprintf('U+%04X', mb_ord($character));

echo $code; // U+2122

Leave a Comment

Cancel reply

Your email address will not be published.