Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

want to see the html tags

Posted on 2013-02-05
3
Medium Priority
?
243 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 35

Accepted Solution

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

echo htmlspecialchars($html_text);
0
 

Author Closing Comment

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

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

Industry Leaders: 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!

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

972 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