title: Interpret escape characters in single quoted string
body: <p>Having a <strong>single-quoted</strong> string:</p>
  
  <pre><code>$content = '\tThis variable is not set by me.\nCannot do anything about it.\n';
  </code></pre>
  
  <p>I would like to inerpret/process the string as if it was <strong>double-quoted</strong>. In other words I would like to replace <strong>all</strong> the possible <strong><a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double" rel="nofollow noreferrer">escape characters</a></strong> (not just tab and linefeed as in this example) with the real values, taking into account that backslash might be escaped as well, thus '\\n' needs to be replaced by '\n'. <strong>eval()</strong> would easily do what I need but I cannot use it.</p>
  
  <p><strong>Is there some simple solution?</strong></p>
  
  <p>(A <strong><a href="https://stackoverflow.com/questions/5241748/php-convert-single-quoted-string-to-double-quoted">similar thread</a></strong> that I found deals with expansion of variables in the single-quoted string while I'm after replacing escape characters.)</p>