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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.