I need to print an HTML tag on screen as texts (and not in code).
I need the readers to literally read the tag.
What is the best practice to do so ?
print htmlspecialchars('<meta name="copyright" content="© Winston Smith, 1984">');
or
print htmlentities('<meta name="copyright" content="© Winston Smith, 1984">');
or none of the above.
- Is there a better way?
- What else should I consider ?
- And last question - should I use print, echo or is there no difference ?
*EDIT I*
I already seen a problem with the character "©" with htmlentities(). This only confirms my doubts - which one is safe to use for all cases - and is there another way to print html tags as text ?