I want to print exact text files of a file. But, as the file contains HTML code (example:
<br/>,
<table> etc.) the formatting of the page changes. I want to echo exactly what the file contains,
<br/>,
<table> etc. printed in the page. How can I do that?
Please help.
2 Answers
Make use of htmlentities() [Pretty heavy when compared to htmlspecialchars()]
<?php
echo htmlentities($yourhtmlcontent);
Alternatively, you could make use of htmlspecialchars() too.