title: Detect CSS class in a page and write if/else in PHP
body: <p>I have a page where I need to detect a CSS class and then apply if/else statement using PHP. How do I do that?</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;body&gt;
      &lt;div class="insights"&gt;
          Hello World
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>What would be the PHP code to detect and find "insights" class exists and show "yes, it exists". If there's no class of that name then show "No, it doesn't exists."</p>
  
  <p>How should I achieve this?</p>