title: How to assign PHP variable to html table cell id
body: <p>I am trying to assign dynamic id to table cell in PHP but it does not seem to be working.</p>
  
  <pre><code>&lt;?php   $var="23,24,25";
          echo $var."\n";
  ?&gt;
  
  &lt;table id="summary-table" border =1 cellspacing="0" cellpadding="0" style="width:100%"&gt;
  &lt;th&gt;Col1&lt;/th&gt;&lt;th&gt;Col2&lt;/th&gt;&lt;th&gt;Ids&lt;/th&gt;
    &lt;tr&gt;
      &lt;td&gt;Row1&lt;/td&gt;
      &lt;td&gt;A&lt;/td&gt;       
      &lt;td id="td-containing-ids" data-ids="23278,62157,325845,568673,607607"&gt;&lt;font color="blue"&gt;3&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Row2&lt;/td&gt;
      &lt;td&gt;B&lt;/td&gt;       
      &lt;!-- trying to add php value to td id  ---&gt;
      &lt;td id="td-containing-ids" data-ids= '&lt;?php $var ?&gt;' &gt;&lt;font color="blue"&gt;4&lt;/font&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>How can I fix this error?</p>