Display HTML entities on browser

I'm trying to display a code of HTML entity on browser, but they do not show up it convert into their respective element on browser window in chrome and all browsers but i want to display the code of html element without converting using php echo function its possible or not please resolve.

Solved

Replace all the & into &. You can use htmlentities() function to do that:

echo htmlentities("");    // <html>

Demo: IDEOne

If you wanna get <html>, then try doing it twice:

echo htmlentities(htmlentities(""));

Demo: IDEOne


Comments

Popular Posts