PHP 8.4.24 Released!

Voting

: max(five, one)?
(Example: nine)

The Note You're Voting On

Maurizio Siliani at trident dot it
19 years ago
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;
}

<< Back to user notes page

To Top