Solved

want to see the html tags

Posted on 2013-02-05
3
215 Views
Last Modified: 2013-02-05
$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
Comment
Question by:rgb192
3 Comments
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
ID: 38855333
Use htmlspecialchars():

echo htmlspecialchars($html_text);
0
 

Author Closing Comment

by:rgb192
ID: 38856211
showed html, thank you
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 38856216
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now