Hi, i have this code, but with the 'else if' i want to include <option> --- Please Select ---- </option> only once before echoing out the next part of the PHP.
<?php
if ($_POST['region'] == '0') {
foreach($EUcountries as $key => $value){
echo '<option value="'.$key.'">'.$value.'</option>';
} }
else if ($_POST['region'] == '1') {
foreach($NONEUcountries as $key => $value){
echo '<option> ---Please Select--- </option>';
echo '<option value="'.$key.'">'.$value.'</option>';
}
}
?>
In the results, if the condition is met, it echo's out like this:
<form>
<select>
<option> ---Please Select--- </option>
<option value="0">Austria</option>
<option> ---Please Select--- </option>
<option value="1">Australia</option>
</select>
</form>
How can i make it so that it only echo's out the 'Please select'?
Thanks