PHP htmlspecialchars is not working
&lt;?php  
&nbsp;&nbsp;&nbsp;&nbsp;$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);  
&nbsp;&nbsp;&nbsp;&nbsp;echo $new;  
?><hr>
 // output should be  
   & lt;a href=& #039;test& #039;&gt;Test& lt;/a& gt; 

but out is   
&lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;
 
PHP htmlspecialchars is not working
===

&lt;?php  
&nbsp;&nbsp;&nbsp;&nbsp;$new = htmlspecialchars("<a href='test'>Test</a>", ENT_QUOTES);  
&nbsp;&nbsp;&nbsp;&nbsp;echo $new;  
?><hr>
 // output should be  
   & lt;a href=& #039;test& #039;&gt;Test& lt;/a& gt; 

but out is   
&lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;
 