时间:2021-07-01 10:21:17 帮助过:28人阅读
$s = ' '; //一个空格加一个制表符
echo current(unpack('H*', $s)); //2009 20是空格的十六进制内码,09是Tab键的十六进制内码
preg_match("/\t+/", $s, $r);
echo current(unpack('H*', $r[0])); //得到 09
preg_match("/ +/", $s, $r);
echo current(unpack('H*', $r[0])); //得到 20
preg_match("/\s+/", $s, $r);
echo current(unpack('H*', $r[0])); //得到 2009