Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 文字がBMP外かどうかを返す
- *
- * 4バイト以上であればBMP外とみなす
- * @param string $utf8Char UTF-8 の1文字
- * @return bool BMP外かどうか
- */
- function isOuterBmpUnicode($utf8Char) {
- $strHex = bin2hex($utf8Char);
- if(strlen($strHex) > 6) {
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement