title: Remove (if it exists) a 'class' attribute from 'a' html element in PHP
body: <p>I would like to remove a 'class' attribute from 'a' html element in PHP.</p>
  
  <p>Example 1:</p>
  
  <pre><code>&lt;p class="red"&gt;Link: &lt;a href="http://www.google.com" style ="margin: 0px"&gt;google&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>&lt;p class="red"&gt;Link: &lt;a href="http://www.google.com" style ="margin: 0px"&gt;google&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <hr>
  
  <p>Example 2:</p>
  
  <pre><code>&lt;p class="red"&gt;Link: &lt;a href="http://www.google.com" class =  "link" style="margin: 0px"  &gt;google&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>&lt;p class="red"&gt;Link: &lt;a href="http://www.google.com" style="margin: 0px"  &gt;google&lt;/a&gt;.&lt;/p&gt;
  </code></pre>