Answer the question
In order to leave comments, you need to log in
How to assign selected select option by value from PHP array?
Hello! There is an array:
Array (
[0] => Array ( [id] => 14 [c_name] => toto [url] => https://ranking.com [repetition] => 3 [ton] => 3 [type] => 2 [date] => 12.04.2018 )
[1] => Array ( [id] => 15 [c_name] => toto [url] => https://ranking.com [repetition] => 1 [ton] => 2 [type] => 4 [date] => 12.04.2018 )
[2] => Array ( [id] => 16 [c_name] => toto [url] => https://ranking.com [repetition] => 2 [ton] => 2 [ton] [type] =>4 [date] => 12.04.2018 ) )
echo "<td class='sel1'><select name=$arr[$i]['url'] class='custom-select ton' >
<option value='0' selected>Не определена</option>
<option value='1'>Положительная</option>
<option value='2'>Отрицательная</option>
<option value='3'>Нейтральная</option>
<option value='4'>Нерелевантная</option>
</select></td>";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question