title: How to concatenate variable and string in following scenario in PHP?
body: <p>I've following PHP code:</p>
  
  <pre><code>&lt;?php
  $rebate_no = 2;
  echo "&lt;table id='blacklistgrid_$rebate_no'  class='table table-bordered table-hover table-striped blacklistgrid'&gt;
          &lt;tr id='reb$rebate_no_1'&gt;
            &lt;td&gt;
              &lt;div class='btn-group'&gt;
                &lt;select name='product_id_$rebate_no[1]' id='product_id_$rebate_no_1' class='form-control prod_list'&gt;
                  &lt;option value='1'&gt;Alabama&lt;/option&gt;
                  &lt;option value='2'&gt;Alaska&lt;/option&gt;
                  &lt;option value='3'&gt;Arizona&lt;/option&gt;
                  &lt;option value='4'&gt;Arkansas&lt;/option&gt;
                  &lt;option value='5'&gt;California&lt;/option&gt;
                &lt;/select&gt;
              &lt;/div&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;";
  ?&gt;
  </code></pre>
  
  <p>In above code I'm having issues in concatenation of variable and string at following lines:</p>
  
  <pre><code>&lt;tr id='reb$rebate_no_1'&gt;
  &lt;select name='product_id_$rebate_no[1]' id='product_id_$rebate_no_1' class='form-control prod_list'&gt;
  </code></pre>
  
  <p>I tried following trick but it didn't work for me.</p>
  
  <pre><code>&lt;tr id='reb'.$rebate_no.'_1'&gt;
  &lt;select name='product_id_$rebate_no[1]' id='product_id_'.$rebate_no.'_1' class='form-control prod_list'&gt;
  </code></pre>
  
  <p>If I check in HTML source I'm getting following HTML:</p>
  
  <pre><code>&lt;tr id="reb" .2.'_1'=""&gt;
  &lt;select id="product_id_" class="form-control prod_list" .2.'_1'="" name="product_id_"&gt;
  </code></pre>
  
  <p>Actually I want the HTML in following desired format:</p>
  
  <pre><code>&lt;tr id='reb2_1'&gt;
  &lt;select name='product_id_2[1]' id='product_id_2_1' class='form-control prod_list'&gt;
  </code></pre>
  
  <p>How to achieve this? Thanks in advance.</p>