title: apostrophe in PHP string
body: <p>This is weird! I have a form which gets info from a DB and then fills in a form with the details. I am trying to cater for cases where a person has a name like O'Neill. At the top of the page (outside the actual form itself) is a line that echoes the user's name to the screen:</p>
  
  <pre><code>&lt;h2&gt;Member Details for &lt;?php echo $thefn; ?&gt;&lt;/h2&gt;
  </code></pre>
  
  <p>And this does indeed display on the page properly, i.e., <strong>Member Details for Mike O'Neill</strong>
  However, in the actual form, where the code runs:</p>
  
  <pre><code>&lt;td&gt;&lt;?php echo "&lt;input type='text' name='fname' value='$thefn' size='30' maxlength='30'&gt;"; ?&gt;&lt;/td&gt;
  </code></pre>
  
  <p>The name is shown with everything after the apostrophe gone! The variable is the same, so what am I doing wrong? This has got me tearing my hair out (and there's a fair amount of that!)</p>