title: php - convert single quoted string to double quoted
body: <p>Been searching here and google for over an hour, can't seem to find the answer to this.</p>
  
  <p>I have a string returned from a database query which contains variables, however it appears that these strings are all returned single-quoted and therefore the variables are not evaluated as they would be if it was double quoted.</p>
  
  <p>what is returned from the sql query would be the $result:</p>
  
  <p>This will not evaluate the 2 variables:</p>
  
  <pre><code>$myname = 'david';
  $occupation = 'Beginner';
  $result = 'Hello my name is $myname and I my occupation is $occupation';
  echo $result;
  </code></pre>
  
  <p>This will evaluate the 2 variables:</p>
  
  <pre><code>$myname = 'david';
  $occupation = 'Beginner';
  $result = "Hello my name is $myname and I my occupation is $occupation";
  echo $result;
  </code></pre>
  
  <p>My question is how do I convert a single-quoted string to a double-quoted string which is able to evaluate the variables ??</p>
  
  <p>Thanks</p>