php – How to see the data in the selection box?

Question:

This is my code:

{assign var=cl_size value=","|explode:$data.cg_cloth_size}
        {$cl_size|@print_r}
        <div class="form-group" align="left" >

        <label for="cartsize">Select Size</label>

        <select class="form-control" style="width:150px;" name="cartsize" required>

        <option value="">Select Size</option>

        {foreach $records as $data}

        <option value="{$data.cg_cloth_size}" {$select_{$data.cg_cloth_size}} >{$data.cg_cloth_size}</option>

        {/foreach}

        </select>

        </div>

I want to see the record in the select box like this: abc

But problem is this data view like a, b, c in this form in select box

Answer:

Could you try this?

{foreach from=$records item=data}
  {$data}
{/foreach}
Scroll to Top