Section vs Article HTML5

In the W3 wiki page about structuring HTML5, it says: <section>: Used to either group different articles into different purposes or subjects, or to define the different sections of a single article. And then displays an image that I cleaned up: It also describes how to use the <article> tag (from same W3 link above): … Read more

Truncate text containing HTML, ignoring tags

Assuming you are using valid XHTML, it’s simple to parse the HTML and make sure tags are handled properly. You simply need to track which tags have been opened so far, and make sure to close them again “on your way out”. <?php header(‘Content-type: text/plain; charset=utf-8’); function printTruncated($maxLength, $html, $isUtf8=true) { $printedLength = 0; $position … Read more