html entities for utf-8 character in php
<p>I have used html_entities for UTF-8 in php.</p>

<pre><code>$input = "&lt;div&gt; 'Testing' &lt;/div&gt;";

echo htmlentities($input,ENT_NOQUOTES,"UTF-8");
</code></pre>

<p>But, above encoding is working for normal input, if i give below input and use encoding then I am getting blank output.</p>

<pre><code>$input = "&lt;div&gt;Other 'user' is working on this line. Please contribute the next line.&lt;/div&gt;";

echo htmlentities($input,ENT_NOQUOTES,"UTF-8");
</code></pre>

<p>I dont know how this is giving blank output.
If i print $input then I am getting below value in $input.</p>

<pre><code>&lt;div&gt;Other user working on this line.�Please contribute the next line.&lt;/div&gt;
</code></pre>

<p>Is any thing missed in htmlentities code, Please folks provide your suggestions.</p>

<p>Thanks,</p>

<p>-Pravin.</p>
