php 拆分html表格,PHP: get_html_translation_table - Manual

If you have troubles (like me) getting data from ISO-8859-1 encoded forms where user copy and paste from word, this routine could be useful.

It adds to the standard get_html_translation_table the codes of the characters usually M$ Word replacs into typed text.

Otherwise those characters would never be displayed correctly in html output.

function get_html_translation_table_CP1252() {

$trans = get_html_translation_table(HTML_ENTITIES);

$trans[chr(130)] = '‚';    // Single Low-9 Quotation Mark

$trans[chr(131)] = 'ƒ';    // Latin Small Letter F With Hook

$trans[chr(132)] = '„';    // Double Low-9 Quotation Mark

$trans[chr(133)] = '…';    // Horizontal Ellipsis

$trans[chr(134)] = '†';    // Dagger

$trans[chr(135)] = '‡';    // Double Dagger

$trans[chr(136)] = 'ˆ';    // Modifier Letter Circumflex Accent

$trans[chr(137)] = '‰';    // Per Mille Sign

$trans[chr(138)] = 'Š';    // Latin Capital Letter S With Caron

$trans[chr(139)] = '‹';    // Single Left-Pointing Angle Quotation Mark

$trans[chr(140)] = 'Œ    ';    // Latin Capital Ligature OE

$trans[chr(145)] = '‘';    // Left Single Quotation Mark

$trans[chr(146)] = '’';    // Right Single Quotation Mark

$trans[chr(147)] = '“';    // Left Double Quotation Mark

$trans[chr(148)] = '”';    // Right Double Quotation Mark

$trans[chr(149)] = '•';    // Bullet

$trans[chr(150)] = '–';    // En Dash

$trans[chr(151)] = '—';    // Em Dash

$trans[chr(152)] = '˜';    // Small Tilde

$trans[chr(153)] = '™';    // Trade Mark Sign

$trans[chr(154)] = 'š';    // Latin Small Letter S With Caron

$trans[chr(155)] = '›';    // Single Right-Pointing Angle Quotation Mark

$trans[chr(156)] = 'œ';    // Latin Small Ligature OE

$trans[chr(159)] = 'Ÿ';    // Latin Capital Letter Y With Diaeresis

ksort($trans);

return $trans;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值