html - PHP: htmlentities not working with variable -


i'm using htmlentities() convert characters Ç , ® character codes. i'm getting texts mysql database.

while($row = mysql_fetch_array($array, mysql_num)){   echo "<div style='float:left; margin-right:40px;'>  <div style='width:148px; height:141px; background-image:url(uploads/".$row[0].")'>    <img src='images/glasscase.png' alt=''/>  </div>  <font style='font-size:20px'>".htmlentities($row[1], ent_quotes,"utf-8")."</font>  <br/>  <font style='font-size:14px'>".htmlentities($row[2], ent_quotes, "utf-8")."</font> </div>"; } 

however $row[2] returning empty string when using htmlentities(). knows what's wrong?

thanks!

why don't scrap 'htmlentities' , use

htmlspecialchars(); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -