Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

want to see the html tags

$html_text='<h1>sample text</h1>';

when I echo $html_text, I get large 'sample text'
I want to see this on the browser screen '<h1>sample text</h1>';

I want to see all the html tags
0
rgb192
Asked:
rgb192
1 Solution
 
gr8gonzoConsultantCommented:
Use htmlspecialchars():

echo htmlspecialchars($html_text);
0
 
rgb192Author Commented:
showed html, thank you
0
 
Ray PaseurCommented:
You might also find that the output is more readable if you put this before the echo htmlentities() or echo htmlspecialchars()

echo '<pre>';
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now