title: How to prevent PHP variables and expressions from expanding in string
body: <p>The following text link works fine when I place it directly in my html:</p>
  
  <pre><code>&lt;a href="http://example.com/index.php?g=&lt;?php echo $grade; ?&gt;&amp;amp;s=&lt;?php if($slcustom29 == 0) echo 1; else echo 0; ?&gt;"&gt;Click here to &lt;?php echo $showOrHideText; ?&gt;  the suggested sequence of lessons.&lt;/a&gt;
  </code></pre>
  
  <p>But I want to replace it with:</p>
  
  <pre><code>&lt;?php echo $gradeNote; ?&gt;
  </code></pre>
  
  <p>Elsewhere $gradeNote is assigned a string based on the grade of the student user. My question after many hours of searching and failing is how can I pass this snippet as a literal string, without PHP attempting to parse it and giving me a junk url? What am I doing wrong here:</p>
  
  <pre><code>$gradeNote = "&lt;a href=\"http://example.com/index.php?g=&lt;?php echo $grade; ?&gt;&amp;amp;s=&lt;?php if($slcustom29 == 0) echo 1; else echo 0; ?&gt;\"&gt;Click here to &lt;?php echo $showOrHideText; ?&gt;  the suggested sequence of lessons.&lt;/a&gt;";
  </code></pre>