I've had a look through the snippets at evil walrus but they all deal with quoting whole pages - I just want a little function which will allow me to quote html tags whenever I need to.
Anyone help?
Quote HTML tags
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Well, I've noticed on evil walrus that there are snippets that give your visitors the ability to click a button and see the source of the whole page they clicked the link from - I just want to be able to quote HTML tags without using those hard to remember symbols.
I'm not sure if this can be done with client-side which is why I'm posting it here.
I'm not sure if this can be done with client-side which is why I'm posting it here.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
OK, I think what you want to do is have things like
visible to the user's without have to write out all the <'s and >'s. In that case you can use PHP to convert the tags so that instead of interpreting them the browser displays them:
htmlspecialchars() will change any <'s, >'s, &'s and "'s to their entity version (<, >, &, ").
Mac
Code: Select all
<p><b>Hello world</b></p>Code: Select all
$html = '<p><b>hello world</b></p>';
echo htmlspecialchars($html);Mac