title: PHP Wrap a string in double quotes
body: <p>I'm attempting to wrap a user-inputted string in double quotes for output but I want to make sure I don't end up with double double quotes on either side of the string. For example, if a user posts </p>
  
  <blockquote>
    <p>"Hello"</p>
  </blockquote>
  
  <p>I don't want to turn it into</p>
  
  <blockquote>
    <p>""Hello""</p>
  </blockquote>
  
  <p>I can do this fairly easily using the code below, however I'm concerned that this may get slow if I'm looping through lots of strings.</p>
  
  <pre><code>$string = '"'.trim($string,'"').'"';
  </code></pre>
  
  <p>If anyone has a better way of doing this, that'd be great. Equally, if anybody can confirm that my way is fine, I'll be happy.</p>
  
  <p>Thanks</p>