title: Escape double quotes of HTML attributes output by PHP
body: <p>Often when writing PHP I'll have it output some HTML like this -</p>
  
  <pre><code>echo "&lt;a href="../" title="link title"&gt;".$link_text."&lt;/a&gt;";
  </code></pre>
  
  <p>Obviously this won't parse as I need to escape the double quotes in the attributes of the <code>&lt;a&gt;</code> element. Is there a regex that would quickly do this rather than me manually adding the backslashes?</p>
  
  <p>One other thing - the regex shouldn't escape double quotes outside of the tag (e.g. where I've appended the <code>$link_text</code> variable.</p>
  
  <p>Any ideas?</p>