$options1 = array( 1=>'= Equals', '≠ Does not Equal', '> Is greater than', '≥ Is greater than or equal to', '< Is less than', '≤ Is less than or equal', '∋ Contains', '∌ Does not contain');
<select name="entry_id_selector[]">';
foreach ( $options1 as $i1=>$opt1 ) :
echo '<option value="' .$i1 .'"'
.($i1 == $entry_id_selector_topic) .'? "selected" : "">'
.$opt1 .'</option>';
endforeach;
echo '</select>';
$entry_id_selector_topic = $_POST['entry_id_selector'];
What is wrong with this part of code .($i1 == $entry_id_selector_topic) .'? "selected" : ""
Default value is = Equals
For example, user select > Is greater than then click on Post button, page reloads. I expect that in drop down menu is selected and displayed value > Is greater than hovewer selected is default value.
Changed to this .($i1 == $entry_id_selector_topic) .'? selected="selected" : "">' Get always selected last item from array ∌ Does not contain
Update. Finally get solution. At first did not understand why $entry_id_selector_topic[0]
does not allways displays the first item from $options1.
But when I choose some value from drop down menu and click submit button, $entry_id_selector_topic = $_POST['entry_id_selector']; the only value that exists is the value I chose from drop down menu. So in $entry_id_selector_topic there is new array with the only item [0].
Seems now the question is clear.