javascript的
string.fromcharcode(252)
和php的
chr(252)得到的结果不一样咋办?
回复内容: javascript的
string.fromcharcode(252)
和php的
chr(252)得到的结果不一样咋办?
//chr() with unicode supportfunction uchr ($codes) { if (is_scalar($codes)) $codes= func_get_args(); $str= ''; foreach ($codes as $code) $str.= html_entity_decode(''.$code.';',ent_noquotes,'utf-8'); return $str;}echo uchr(252);//输出和string.fromcharcode(252)相同了
