php - create dyanamic dropdown using Codeigniter form helper and get value from database -


my array this

array ( [0] => array ( [id] => 1 [name] => admin )

[1] => array     (         [id] => 2         [name] => manager     )  [2] => array     (         [id] => 3         [name] => user     )  [3] => array     (         [id] => 6         [name] => visitor     )  [4] => array     (         [id] => 35         [name] => gggggggggg     ) 

)

and trying create

foreach($data $row) {                     $dropdownlist[$row['id']] = $row['name'];                 } $insattr = "class='form-control'"; echo form_dropdown("iddropdown", $dropdownlist, "", $insattr); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -