I have returned a result_array() in $categories variable and now I want to create a dropdown menu. But if I directly use the variable, all the elements of the array are going to be displayed. However I just want to display the name and keep its id as value. How do i do it?
$options = $categories;
echo form_dropdown('category', $options);
I want something like
<select name="category">
<option value="1"> ABC </option>
.....
<option value="10"> NNNC </option>
</select>