I have an php array called locArray thats stores an array of locations retrieved from a Database e.g. House 1, House 2 etc. I'm populating a dropdown list with the array and I want the selected index to be the location stored in another table (Person's location) . As it stands the dropdown list selects the first location no matter which location is in the Person's location variable

```
 <select id="accommodation" name="accommodation" onchange="show()" >
        <?php
        foreach ($locArray as $value) {
        echo'<option value="'.$value.'">'.$value.'</option>'; 
        }
        ?>
    </select>

```