title: HTML forms, php and apostrophes
body: <p>Doing a uni assignment with HTML, XML and php 5.3 (no SQL). Building a review website. I have a textarea in which the user can place their comments. If the user enters an apostrophe, eg World's Best Uni!, when I echo $_REQUEST['reviewtext'] I get World\'s Best Uni!</p>
  
  <p>To massage the data for saving in the XML, I have the following code:</p>
  
  <pre><code>$cleantext1 = htmlspecialchars($_REQUEST['reviewtext']);
  substr_replace($cleantext1,"\'","&amp;#39;");
  $cleantext2 = strip_tags($cleantext1);
  $cleantext3 = utf8_encode($cleantext2);
  </code></pre>
  
  <p>I have echo's at each step an the quote remains World\'s Best Uni! at each step.
  I expected the one of the first two lines to replace the escaped apostrophe with an html code but it doesn't seem to work. </p>
  
  <p>Interestingly, this problem doesn't happen on my local XAMPP server; only on my hosted website.</p>
  
  <p>Any suggestions?
  Thanks,
  Sean</p>