Added the ability to have optgroups in form_dropdown() within the form helper.
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index c002c6f..01d0ea7 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -268,11 +268,26 @@
 		foreach ($options as $key => $val)
 		{
 			$key = (string) $key;
-			$val = (string) $val;
 
-			$sel = (in_array($key, $selected))?' selected="selected"':'';
+			if (is_array($val))
+			{
+				$form .= '<optgroup label="'.$key.'">'."\n";
 
-			$form .= '<option value="'.$key.'"'.$sel.'>'.$val."</option>\n";
+				foreach ($val as $optgroup_key => $optgroup_val)
+				{
+					$sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
+
+					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
+				}
+
+				$form .= '</optgroup>'."\n";
+			}
+			else
+			{
+				$sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
+
+				$form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
+			}
 		}
 
 		$form .= '</select>';
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 7892dc3..9a3b613 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -82,6 +82,7 @@
 	</li>
 	<li>Helpers
 		<ul>
+			<li>Added the ability to have optgroups in <kbd>form_dropdown()</kbd> within the <a href="helpers/form_helper.html">form helper</a>.</li>
 			<li>Added a doctype() function to the <a href="helpers/html_helper.html">HTML helper</a>.</li>
 			<li>Added ability to force lowercase for url_title() in the <a href="helpers/url_helper.html">URL helper</a>.</li>
 		</ul>
diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html
index 2bb2a4a..8504ac0 100644
--- a/user_guide/helpers/form_helper.html
+++ b/user_guide/helpers/form_helper.html
@@ -239,6 +239,7 @@
 <br />
 echo form_dropdown('shirts', $options, 'large', $js);</code>
 
+<p>If the array passed as $options is a multidimensional array, form_dropdown() will produce an &lt;optgroup&gt; with the array key as the label.</p>
 
 <h2>form_fieldset()</h2>