Jump to content

convert html tags to text


jeff5656

Recommended Posts

In a text box I put in some code snippets that I want to refer to later, but when I display it, it displays it in html.  How do I convert the code into pure text so it displays the actual code?

 

If I try strip_tags, that just strips it (and it doesn't work with php).  And I can't use strip_tags with conditions, because I don't want to list all codes!

 

Also, the code has both html tags and php code - I just want that whole thing to be displayed as is, without havign the browser try to "read" it. 

 

Also if I put this into the text box, <td><?php echo date ("m/d/Y", strtotime($row['code_date']));?></td> then nothing is displayed.

If I put this in the box:  <input class="button" style="display:inline"  name="whatever" type="submit" value="Press here" />

 

then I get an actual submit button instead of the code!

 

Link to comment
https://forums.phpfreaks.com/topic/235425-convert-html-tags-to-text/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.