• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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