« Back HTML special characters tool
Published: 12 Dec 2010
When you're adding content to a website, you often need to work around certain characters who have double meanings on the web. For example, the symbol > to a site's users means greater than, or a handy arrow. But the the browser that sorts everything on a web page into nicely formatted blocks, this symbol means that you're about to write some HTML. So, including these characters in a page can cause problems.
The easy way around it is to use one of two PHP functions, htmlspecialchars() or htmlentities(). This will solve the problem if you're extracting content from the database, but if you're wanting to write these characters into a template or blog post, you might need to do it manually.
We whipped up a special character converter for when we want to add <code> to our blog posts, and put it up for anyone to use at incodius.co.nz/htmlcharstool. Enjoy!
« Back
