使用PHP查找字符的unicode [英] Using PHP to find unicode of a character

查看:149
本文介绍了使用PHP查找字符的unicode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何获取utf-8字符串中给定字符的代码点号?

Possible Duplicate:
How to get code point number for a given character in a utf-8 string?

我在javascript中有一个示例代码:

I have a sample code in javascript:

var str = "HELLO WORLD";
var n = str.charCodeAt(0);

这将返回72

如何在PHP中做到这一点?

How do I make this done in PHP?

推荐答案

上述等同于

$str = "HELLO WORLD";
$n = ord($str[0]);

这篇关于使用PHP查找字符的unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆