title: Use PHP Variable In str_replace
body: <p>I have this code</p>
  
  <pre><code>$html = str_replace( '&lt;a','&lt;a class="name"', $html );
  </code></pre>
  
  <p>And i need to add a variable like this to the code</p>
  
  <pre><code>$html = str_replace( '&lt;a','&lt;a class="$var"', $html );
  </code></pre>
  
  <p>But this doesn't work.</p>
  
  <p><strong>Edit :</strong> Is it possible to do this using sprintf?</p>
  
  <p>Any ideas on how i can do this :</p>