title: How to escape variable name in PHP's Heredoc?
body: <p>I have a variable <code>$foo</code> with some id in it and I want to use it in Heredoc string in PHP like this:</p>
  
  <pre><code>$text = &lt;&lt;&lt;TEXT
    &lt;div id="$foo_bar"&gt;&lt;/div&gt;
  TEXT;
  </code></pre>
  
  <p>Obvious problem is that PHP parses variable in Heredoc as <code>$foo_bar</code> which of course, doesn't exist. What I want is to parse <code>$foo</code> variable and "_bar" should be treated as regular text. </p>
  
  <p>Is it possible to use some kind of escape character or it can't be achieved ?</p>
  
  <p>P.S.: Yes, I know I can use quoted string instead of Heredoc, but I must use Heredoc (I have a ton of text and code in it with quotes, etc).</p>