Use of htmlentities() function..

by Naveenkumar 2013-12-02 15:34:44

Use of htmlentities() function..


If you want to show the output in browser that are related to html tags are not shown..

Because the browser understand that it was an html code so it is not displayed..

For example,

Your Code will be



echo "<bcd><br /> <def>
the solution is to use htmlentities...";



when u displaying the above output in browser it shows only "the solution is to use htmlentities..."

B'coz the browser understands that <bcd><def> are html tags and its not displaying...

To avoid this,

use htmlentities() function.

For example,



echo htmlentities("<bcd> <def> the solution is to use htmlentities...");



The above code will output,


"<bcd><br /> <def>
the solution is to use htmlentities..."

639
like
0
dislike
0
mail
flag

You must LOGIN to add comments