javascript的
String.fromCharCode(252)
和PHP的
chr(252)得到的结果不一样咋办?
javascript的
String.fromCharCode(252)
和PHP的
chr(252)得到的结果不一样咋办?
<code class="php">//chr() with unicode support function 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)相同了</code>