title: How to work a variable inside quotes when the entire code in side a quote
body: <p>I'm wired little bit about this.This is the code what i mean.</p>
  <pre><code>&lt;div class='pagination-container'&gt;
      &lt;nav&gt;
          &lt;ul class=&quot;pagination&quot;&gt;
  
              &lt;li data-page=&quot;prev&quot;&gt;
                  &lt;span&gt;
                      &lt; 
                  &lt;span class=&quot;sr-only&quot;&gt;(current)
                  &lt;/span&gt;&lt;/span&gt;
              &lt;/li&gt;
              &lt;!--    Here the JS Function Will Add the Rows --&gt;
              &lt;li data-page=&quot;next&quot; id=&quot;prev&quot;&gt;
                  &lt;span&gt; &gt; &lt;span class=&quot;sr-only&quot;&gt;(current)&lt;/span&gt;&lt;/span&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/nav&gt;
  &lt;/div&gt;
  
  &lt;?php 
  $jquery = '
  for (var i = 1; i &lt;= pagenum;) {  
      $(&quot;.pagination #prev&quot;).before(&quot;&lt;li data-page= \' i \' &gt;&lt;span&gt; \' i++ \' &lt;span class=\'sr-only\'&gt;(current)&lt;/span&gt;&lt;/span&gt;\&lt;/li&gt;&quot;).show();
  } 
  '; 
  $this-&gt;registerJs($jquery, View::POS_READY);
  ?&gt;
  </code></pre>
  <p>Here the entire jquery codes are inside a single quoted php variable.The jquery forloop variable &quot;<strong>i</strong>&quot; didn't actually get the list it gets as the text iteself i.so the loop didn't work correctly.
  I tried some combinations of quotes here like &quot;&lt;li data-page= &quot;'&quot; + i + &quot;'&quot; &gt; and so on but didn't work</p>
  <p>regards.</p>