document.write('<link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/>')





document.write('<div id=\"gist-148187\" class=\"gist\">\n  \n  \n    \n            \n\n      <div class=\"gist-file\">\n        <div class=\"gist-data gist-syntax\">\n          \n          \n          \n            <div class=\"gist-highlight\"><pre><div class=\"line\" id=\"LC1\">	/**<\/div><div class=\"line\" id=\"LC2\">	 * Return an html options list full of states<\/div><div class=\"line\" id=\"LC3\">	 * <\/div><div class=\"line\" id=\"LC4\">	 * @param $selected_state string[optional]	abbreviation of state to select<\/div><div class=\"line\" id=\"LC5\">	 * @param $b_add_space bool[optional]		first option is blank<\/div><div class=\"line\" id=\"LC6\">	 * @return string<\/div><div class=\"line\" id=\"LC7\">	 */<\/div><div class=\"line\" id=\"LC8\">	public static function state_picker_options( $selected_state = &quot;&quot;, $b_add_space=false )<\/div><div class=\"line\" id=\"LC9\">	{<\/div><div class=\"line\" id=\"LC10\">		$states = array(<\/div><div class=\"line\" id=\"LC11\">			\'AL\' =&gt; \'ALABAMA\',<\/div><div class=\"line\" id=\"LC12\">			\'AK\' =&gt; \'ALASKA\',<\/div><div class=\"line\" id=\"LC13\">			\'AZ\' =&gt; \'ARIZONA\',<\/div><div class=\"line\" id=\"LC14\">			\'AR\' =&gt; \'ARKANSAS\',<\/div><div class=\"line\" id=\"LC15\">			\'CA\' =&gt; \'CALIFORNIA\',<\/div><div class=\"line\" id=\"LC16\">			\'CO\' =&gt; \'COLORADO\',<\/div><div class=\"line\" id=\"LC17\">			\'CT\' =&gt; \'CONNECTICUT\',<\/div><div class=\"line\" id=\"LC18\">			\'DE\' =&gt; \'DELAWARE\',<\/div><div class=\"line\" id=\"LC19\">			\'DC\' =&gt; \'DISTRICT OF COLUMBIA\',<\/div><div class=\"line\" id=\"LC20\">			\'FL\' =&gt; \'FLORIDA\',<\/div><div class=\"line\" id=\"LC21\">			\'GA\' =&gt; \'GEORGIA\',<\/div><div class=\"line\" id=\"LC22\">			\'HI\' =&gt; \'HAWAII\',<\/div><div class=\"line\" id=\"LC23\">			\'ID\' =&gt; \'IDAHO\',<\/div><div class=\"line\" id=\"LC24\">			\'IL\' =&gt; \'ILLINOIS\',<\/div><div class=\"line\" id=\"LC25\">			\'IN\' =&gt; \'INDIANA\',<\/div><div class=\"line\" id=\"LC26\">			\'IA\' =&gt; \'IOWA\',<\/div><div class=\"line\" id=\"LC27\">			\'KS\' =&gt; \'KANSAS\',<\/div><div class=\"line\" id=\"LC28\">			\'KY\' =&gt; \'KENTUCKY\',<\/div><div class=\"line\" id=\"LC29\">			\'LA\' =&gt; \'LOUISIANA\',<\/div><div class=\"line\" id=\"LC30\">			\'ME\' =&gt; \'MAINE\',<\/div><div class=\"line\" id=\"LC31\">			\'MD\' =&gt; \'MARYLAND\',<\/div><div class=\"line\" id=\"LC32\">			\'MA\' =&gt; \'MASSACHUSETTS\',<\/div><div class=\"line\" id=\"LC33\">			\'MI\' =&gt; \'MICHIGAN\',<\/div><div class=\"line\" id=\"LC34\">			\'MN\' =&gt; \'MINNESOTA\',<\/div><div class=\"line\" id=\"LC35\">			\'MS\' =&gt; \'MISSISSIPPI\',<\/div><div class=\"line\" id=\"LC36\">			\'MO\' =&gt; \'MISSOURI\',<\/div><div class=\"line\" id=\"LC37\">			\'MT\' =&gt; \'MONTANA\',<\/div><div class=\"line\" id=\"LC38\">			\'NE\' =&gt; \'NEBRASKA\',<\/div><div class=\"line\" id=\"LC39\">			\'NV\' =&gt; \'NEVADA\',<\/div><div class=\"line\" id=\"LC40\">			\'NH\' =&gt; \'NEW HAMPSHIRE\',<\/div><div class=\"line\" id=\"LC41\">			\'NJ\' =&gt; \'NEW JERSEY\',<\/div><div class=\"line\" id=\"LC42\">			\'NM\' =&gt; \'NEW MEXICO\',<\/div><div class=\"line\" id=\"LC43\">			\'NY\' =&gt; \'NEW YORK\',<\/div><div class=\"line\" id=\"LC44\">			\'NC\' =&gt; \'NORTH CAROLINA\',<\/div><div class=\"line\" id=\"LC45\">			\'ND\' =&gt; \'NORTH DAKOTA\',<\/div><div class=\"line\" id=\"LC46\">			\'OH\' =&gt; \'OHIO\',<\/div><div class=\"line\" id=\"LC47\">			\'OK\' =&gt; \'OKLAHOMA\',<\/div><div class=\"line\" id=\"LC48\">			\'OR\' =&gt; \'OREGON\',<\/div><div class=\"line\" id=\"LC49\">			\'PA\' =&gt; \'PENNSYLVANIA\',<\/div><div class=\"line\" id=\"LC50\">			\'PR\' =&gt; \'PUERTO RICO\',<\/div><div class=\"line\" id=\"LC51\">			\'RI\' =&gt; \'RHODE ISLAND\',<\/div><div class=\"line\" id=\"LC52\">			\'SC\' =&gt; \'SOUTH CAROLINA\',<\/div><div class=\"line\" id=\"LC53\">			\'SD\' =&gt; \'SOUTH DAKOTA\',<\/div><div class=\"line\" id=\"LC54\">			\'TN\' =&gt; \'TENNESSEE\',<\/div><div class=\"line\" id=\"LC55\">			\'TX\' =&gt; \'TEXAS\',<\/div><div class=\"line\" id=\"LC56\">			\'UT\' =&gt; \'UTAH\',<\/div><div class=\"line\" id=\"LC57\">			\'VT\' =&gt; \'VERMONT\',<\/div><div class=\"line\" id=\"LC58\">			\'VI\' =&gt; \'VIRGIN ISLANDS\',<\/div><div class=\"line\" id=\"LC59\">			\'VA\' =&gt; \'VIRGINIA\',<\/div><div class=\"line\" id=\"LC60\">			\'WA\' =&gt; \'WASHINGTON\',<\/div><div class=\"line\" id=\"LC61\">			\'WV\' =&gt; \'WEST VIRGINIA\',<\/div><div class=\"line\" id=\"LC62\">			\'WI\' =&gt; \'WISCONSIN\',<\/div><div class=\"line\" id=\"LC63\">			\'WY\' =&gt; \'WYOMING\'<\/div><div class=\"line\" id=\"LC64\">		);<\/div><div class=\"line\" id=\"LC65\">&nbsp;<\/div><div class=\"line\" id=\"LC66\">		$s_options_list = &quot;&quot;;<\/div><div class=\"line\" id=\"LC67\">&nbsp;<\/div><div class=\"line\" id=\"LC68\">		//add blank state?<\/div><div class=\"line\" id=\"LC69\">		if($b_add_space)<\/div><div class=\"line\" id=\"LC70\">		{<\/div><div class=\"line\" id=\"LC71\">			$s_options_list .= &quot;&lt;option value=\'\'&gt;&lt;/option&gt;&quot;;<\/div><div class=\"line\" id=\"LC72\">		}<\/div><div class=\"line\" id=\"LC73\">&nbsp;<\/div><div class=\"line\" id=\"LC74\">		//construct list<\/div><div class=\"line\" id=\"LC75\">		foreach( $states as $st =&gt; $name )<\/div><div class=\"line\" id=\"LC76\">		{<\/div><div class=\"line\" id=\"LC77\">			if( strtolower($st) == strtolower( $selected_state ) )<\/div><div class=\"line\" id=\"LC78\">			{<\/div><div class=\"line\" id=\"LC79\">				$s_options_list .= &quot;&lt;option value=\'$st\' selected&gt; $name &lt;/option&gt;&quot;;<\/div><div class=\"line\" id=\"LC80\">			}<\/div><div class=\"line\" id=\"LC81\">			else<\/div><div class=\"line\" id=\"LC82\">			{<\/div><div class=\"line\" id=\"LC83\">				$s_options_list .= &quot;&lt;option value=\'$st\'&gt; $name &lt;/option&gt;&quot;;<\/div><div class=\"line\" id=\"LC84\">			}<\/div><div class=\"line\" id=\"LC85\">		}<\/div><div class=\"line\" id=\"LC86\">&nbsp;<\/div><div class=\"line\" id=\"LC87\">		return $s_options_list;		<\/div><div class=\"line\" id=\"LC88\">	}<\/div><\/pre><\/div>\n        \n        <\/div>\n\n        <div class=\"gist-meta\">\n          <a href=\"http://gist.github.com/raw/148187/e5d36acbe2ab1ec8fe32236d6aaf45f8dcdf7c21/php%20state%20picker\" style=\"float:right;\">view raw<\/a>\n          <a href=\"http://gist.github.com/148187#file_php state picker\" style=\"float:right;margin-right:10px;color:#666\">php state picker<\/a>\n          <a href=\"http://gist.github.com/148187\">This Gist<\/a> brought to you by <a href=\"http://github.com\">GitHub<\/a>.\n        <\/div>\n      <\/div>\n    \n  \n<\/div>\n')
