[Solved] Get first and second element of array [duplicate]
From your code it looks like you actually want the key and the value… <select name=”country”> <?php foreach($countryArray as $code=>$country){ echo “<option value=”.$code.”>”.$country.”</option>”; } </select 1 solved Get first and second element of array [duplicate]