Applying htmlentities ENT_QUOTES on array
<p>I have an array $fields:</p>

<pre><code>Array
(
    [NAME] =&gt; M'y Na'me
)
</code></pre>

<p>I want to convert those apostrophes to entities. When I run:</p>

<pre><code>array_map('htmlentities', &amp;$fields, array_fill(0 , count($fields) , ENT_QUOTES) );
</code></pre>

<p>and then <code>print_r $fields</code> nothing seems to have changed?</p>

<pre><code>Array
(
    [NAME] =&gt; M'y Na'me
)
</code></pre>

<p>How can I apply htmlentities with <code>ENT_QUOTES</code> on all elements in <code>$fields</code>?</p>

<p>EDIT: this makes me lose my keys</p>

<pre><code>$fields = array_map('htmlentities', $fields, array_fill(0 , count($fields) , ENT_QUOTES) );
</code></pre>
