get_html_translation_table expects at most 2 parameters, 3 given
<p>The server is running with <strong>PHP 5.2.17</strong>, and I am trying to run get_html_translation_table() with three arguments. Here is how I invoke the function: </p>

<pre><code>$text = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, "UTF-8");
</code></pre>

<p>I am getting a warning message saying </p>

<blockquote>
  <p>get_html_translation_table expects at most 2 parameters, 3 given
  (filename and line number).</p>
</blockquote>

<p>Per <a href="http://php.net/manual/en/function.get-html-translation-table.php#refsect1-function.get-html-translation-table-changelog" rel="nofollow">PHP Documentation</a>, the third argument is supported <strong>after PHP 5.3.4,</strong> but adding the third argument is the only way I can think of to encode the array returned in "UTF-8". (It works despite the ugly warning message.) </p>

<p>I need get_html_translation_table() to create a function that encode <strong>all html special characters and spaces</strong>, and the following function just won't work without the third argument. </p>

<pre><code>/**
 * Trying to encoding all html special characters, including nl2br()
 * @param string  $original
 * @return string
 */
function ecode_html_sp_chars($original) {
    $table = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, "UTF-8");
    $table[' '] = '&amp;nbsp;';
    $encoded = strtr($original, $table);
    return nl2br($encoded);
}
</code></pre>
