The CodeIgniter documentation is vague on how to set the default value in a select tag when you are using the form helper. There’s a third parameter to the
set_select method that’s a boolean.
I recommend using something like the following code snippet:
So you have to check the value of the
$option variable with each iteration of the loop and if it matches another variable (which you should set in your controller) it sets the TRUE that the
set_select method requires.