ent2ncr() – Converts named entities into numbered entities.

You appear to be a bot. Output may be restricted

Description

Converts named entities into numbered entities.

Usage

$string = ent2ncr( $text );

Parameters

$text
( string ) required – The text within which entities will be converted.

Returns

string Text with converted entities.

Source

File name: wordpress/wp-includes/formatting.php
Lines:

1 to 100 of 278
function ent2ncr( $text ) {

  
/**
 * Filters text before named entities are converted into numbered entities.
 *
 * A non-null string must be returned for the filter to be evaluated.
 *
 * @since 3.3.0
 *
 * @param string|null $converted_text The text to be converted. Default null.
 * @param string      $text           The text prior to entity conversion.
 */
  $filtered = apply_filters( 'pre_ent2ncr', null, $text );
  if ( null !== $filtered ) {
    return $filtered;
  }

  $to_ncr = array(
    '"'     => '"',
    '&'      => '&',
    '<'       => '<',
    '>'       => '>',
    '|'          => '|',
    ' '     => ' ',
    '¡'    => '¡',
    '¢'     => '¢',
    '£'    => '£',
    '¤'   => '¤',
    '¥'      => '¥',
    '¦'   => '¦',
    '&brkbar;'   => '¦',
    '§'     => '§',
    '¨'      => '¨',
    '¨'      => '¨',
    '©'     => '©',
    'ª'     => 'ª',
    '«'    => '«',
    '¬'      => '¬',
    '­'      => '­',
    '®'      => '®',
    '¯'     => '¯',
    '&hibar;'    => '¯',
    '°'      => '°',
    '±'   => '±',
    '²'     => '²',
    '³'     => '³',
    '´'    => '´',
    'µ'    => 'µ',
    '¶'     => '¶',
    '·'   => '·',
    '¸'    => '¸',
    '¹'     => '¹',
    'º'     => 'º',
    '»'    => '»',
    '¼'   => '¼',
    '½'   => '½',
    '¾'   => '¾',
    '¿'   => '¿',
    'À'   => 'À',
    'Á'   => 'Á',
    'Â'    => 'Â',
    'Ã'   => 'Ã',
    'Ä'     => 'Ä',
    'Å'    => 'Å',
    'Æ'    => 'Æ',
    'Ç'   => 'Ç',
    'È'   => 'È',
    'É'   => 'É',
    'Ê'    => 'Ê',
    'Ë'     => 'Ë',
    'Ì'   => 'Ì',
    'Í'   => 'Í',
    'Î'    => 'Î',
    'Ï'     => 'Ï',
    'Ð'      => 'Ð',
    'Ñ'   => 'Ñ',
    'Ò'   => 'Ò',
    'Ó'   => 'Ó',
    'Ô'    => 'Ô',
    'Õ'   => 'Õ',
    'Ö'     => 'Ö',
    '×'    => '×',
    'Ø'   => 'Ø',
    'Ù'   => 'Ù',
    'Ú'   => 'Ú',
    'Û'    => 'Û',
    'Ü'     => 'Ü',
    'Ý'   => 'Ý',
    'Þ'    => 'Þ',
    'ß'    => 'ß',
    'à'   => 'à',
    'á'   => 'á',
    'â'    => 'â',
    'ã'   => 'ã',
    'ä'     => 'ä',
    'å'    => 'å',
    'æ'    => 'æ',
    'ç'   => 'ç',
    'è'   => 'è',
    'é'   => 'é',
 

 View on GitHub View on Trac