I am working with htmlentites() to replace characters with safe html, namely the PHP because I want to be able to show PHP examples. The problem I am running into is all the tags are replaced (ex: </p>, </br> etc). I know I can write a custom htmentities to only replace the <? tags and other specific xml tags but I was wondering is there something in PHP that already does this?
-
It appears that stakoverflow tags actual convert to html....its this an error or do I have to escape them on here to display themDevin Dixon– Devin Dixon2011-04-17 15:33:01 +00:00Commented Apr 17, 2011 at 15:33
-
Still I don't actually understand what you are talking about.sh03– sh032011-04-17 15:34:37 +00:00Commented Apr 17, 2011 at 15:34
-
1@Charliepiga - nice edit, far faster than what I did...AJ.– AJ.2011-04-17 15:35:26 +00:00Commented Apr 17, 2011 at 15:35
Add a comment
|
1 Answer
I would use the highlight_string() function in PHP as it will escape the characters and syntax highlight the code.