I have a table and I put the values in it with an array I want to add a select tag that takes the values in each row of the table from the array and displays them in the select and sends the new values through the post method. please help
<?php for ($i = 0; $i < count($pays_percents); $i++) { ?>
<td>
<select class="form-control" name="pay_method[]" id="pay_method">
<option value="0" <?php if ($pay_method[$i] == '0') echo 'selected=""'; ?>>نقد</option>
<option value="1" <?php if ($pay_method[$i] == '1') echo 'selected=""'; ?>>چک</option>
<option value="2" <?php if ($pay_method[$i] == '2') echo 'selected=""'; ?>>کارت خوان</option>
<option value="3" <?php if ($pay_method[$i] == '3') echo 'selected=""'; ?>>کارت به کارت</option>
</select>
</td>
<?php } ?>