Dymically Doropdown Optiongroup Using Cdbcriteria

hello,

Please how do i dynamically generate array of data in this format.? What i want to achieve is to use this data with my dropdown list as optiongroup data

$data=array(

            'one'=>array(


                '1'=>'Satu',


                '2'=>'Dua',


                '3'=>'Tiga',


            ),


            'two'=>array(


                '1'=>'Sidji',


                '2'=>'Loro',


                '3'=>'Telu',


            ),


            'three'=>array(


                '1'=>'Hiji',


                '2'=>'Dua',


                '2'=>'Tilu',


            ),


        );



$data=array();

//find maincateogry

foreach($maincategory as $val1)

{

    //find sub category of main category store in to $subcat

    forech($subcat as $val2)

        $data[$val1][]=$val2;


    /** 

     * $data[$val1]['here you can give custom value which will be set as the value of that option']=$val2;

     */


}

echo CHtml::dropDownList('name','',$data);