title: PHP: Check whether an HTML element has a certain class
body: <p>I'd like to present links to similar topics at the end of of a blog entry. My strategy would be to quote the topic tag as class attribute to the html or body element:</p>
  
  <pre><code>&lt;html class="bears honey alaska"&gt;
  </code></pre>
  
  <p>And make a simple PHP function at the bottom of the page: "If  has class 'bears', include bears.php here." Without any elses.</p>
  
  <p>Could someone help me with the code?</p>
  
  <p>The data-attribute in HTML 5 might be more appropriate for that, but I don't know if PHP can address them.</p>
  
  <p>Thanks.
  Runa</p>