title: Add Classes to an SVG element after using PHP's file_get_contents
body: <p>I need to fetch an SVG image and insert the image onto a page. I am fetching the image using:</p>
  
  <pre><code>&lt;?php echo file_get_contents("logo.svg"); ?&gt;
  </code></pre>
  
  <p>which outputs something like</p>
  
  <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24""&gt;
      &lt;path d="M12 2c5.514 0 10 4.486"&gt;&lt;/path&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>How would I go about adding a class to the SVG element after inserting onto the page? As in:</p>
  
  <pre><code>&lt;svg class="LogoStyle" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24""&gt;
      &lt;path d="M12 2c5.514 0 10 4.486"&gt;&lt;/path&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>or targeting to the path element:</p>
  
  <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24""&gt;
      &lt;path class="LogoStyle" d="M12 2c5.514 0 10 4.486"&gt;&lt;/path&gt;
  &lt;/svg&gt;
  </code></pre>
  
  <p>Any help would be nice, thanks!</p>