时间:2021-07-01 10:21:17 帮助过:38人阅读
$s = "广东";
$s = iconv('gbk', 'utf-8', $s);
$r = array_map('ord', str_split($s));
print_r($r);
Array
(
[0] => 229
[1] => 185
[2] => 191
[3] => 228
[4] => 184
[5] => 156
)
$s = "广东";
$s = iconv('gbk', 'utf-8', $s);
$r = unpack('C*', $s);
print_r($r);
Array或
(
[1] => 229
[2] => 185
[3] => 191
[4] => 228
[5] => 184
[6] => 156
)
$s = "广东";
$s = iconv('gbk', 'utf-8', $s);
$r = unpack('c*', $s);
print_r($r);
Array
(
[1] => -27
[2] => -71
[3] => -65
[4] => -28
[5] => -72
[6] => -100
)