-1

I'm trying to generate HTML using PHP and have that HTML printed out and displayed on a site for a user to then copy and paste elsewhere. My problem, however, is that whenever I try to use print or echo statements and type in the HTML, the HTML is being rendered instead of simply just printed. I even put the HTML as a string into a variable and tried printing/echoing that variable but it was also rendered. Is there any way to literally just have the words I'm typing (which happen to be HTML) printed or displayed in some way on the page in a box or something of the sort?

N.S.
  • 13
  • 2

1 Answers1

0

if I understood your question, I think you should use htmlentities():

print htmlentities('<br>');

This wil show the tag instead of generate a new line.

CJ Nimes
  • 648
  • 7
  • 10