title: using php to encode characters for mailto in javascript?
body: <p>I am using <code>window.location.href = 'mailto:?body=visit <a href="http://example.com/?content=link" rel="nofollow">http://example.com/?content=link</a>';</code></p>
  
  <p>which works fine, but the way the link is built is <code>window.location.href = 'mailto:?body=&lt;?php echo $content; ?&gt;';</code></p>
  
  <p>now this works fine unless <code>$content</code> contains <code>'</code> or something similar which breaks the code.</p>
  
  <p>How can I make this work?</p>