I'm collecting data from a form into a session, on another form, I use a few variables to feed a SELECT option, which works as I want. as shown here
<select class="select2_category form-control" data-placeholder="Choose a Category" tabindex="1" id="householder" name="householder">
<option value=""></option>
<option value="A"><?php echo $_SESSION["name1"];?></option>
<option value="B"><?php echo $_SESSION["name2"];?></option>
<option value="C"><?php echo $_SESSION["name3"];?></option>
<option value="D"><?php echo $_SESSION["name4"];?></option> </select>
My issue is how I can change this, currently if within the form, any names are left blank then when it comes to the SELECT, there is a blank line for every option blank, is there a way to change this and if a variable is blank then ignore and use the next variable, this would then make my SELECT look tidy