Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.w3.org/TR/xml/#sec-predefined-ent" rel="nofollow">XML does only know the entities <em>lt</em>, <em>gt</em>, <em>amp</em>, <em>apos</em>, and <em>quot</em>.</a> So any other <a href="http://www.w3.org/TR/xml/#NT-EntityRef" rel="nofollow">entity reference</a> will raise an error. (Note that <a href="http://www.w3.org/TR/xml/#NT-CharRef" rel="nofollow">character references</a> and entity references are not the same.)</p> <p>You can use <a href="http://php.net/strtr" rel="nofollow"><code>strtr</code></a> to convert any HTML entity reference that is not also known in XML:</p> <pre><code>$trans = array_map('utf8_encode', array_flip(array_diff(get_html_translation_table(HTML_ENTITIES), get_html_translation_table(HTML_SPECIALCHARS)))); $output = strtr($input, $trans); </code></pre> <p><a href="http://php.net/get_html_translation_table" rel="nofollow"><code>get_html_translation_table</code></a> returns an array for the mapping of character onto entity reference. <code>get_html_translation_table(HTML_ENTITIES)</code> returns a mapping for all entities while <code>get_html_translation_table(HTML_SPECIALCHARS)</code> returns only those mentioned above. <a href="http://php.net/array_diff" rel="nofollow"><code>array_diff</code></a> will give the difference, so all entities without those mentioned above. <code>array_flip</code> inverts the key/value association and applying <a href="http://php.net/array_map" rel="nofollow"><code>array_map</code></a> with <a href="http://php.net/utf8_encode" rel="nofollow"><code>utf8_encode</code></a> will convert the values from ISO 8859-1 to UTF-8.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload