<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

    function dropdown_option($options=array(), $selected=''){

        $option = '<option value="">--- Select ---</option>';
        foreach ($options as $key => $val)
        {
            $sel = ($key==$selected)? ' selected="selected"' : '';
            $option .= '<option value="'.$key.'"'.$sel.'>'.(string)$val."</option>\n";
        }
        return $option;

    }
