![]() |
How to get to split the select value Question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: How to get to split the select value Question (/showthread.php?tid=64115) |
How to get to split the select value Question - wolfgang1983 - 01-15-2016 On my select drop down value I have it producing some thing like Code: <option value="codepen/4">Codepen RSS Feed > Home Page</option> And code pen is "code" and 4 is id. My question is how on my function could I be able to get the name and id seperate PHP Code: foreach ($layout_data['layout_module'] as $layout_module) { Any suggestions thank you. Update I have tried now explode() seems to work have I got it correct PHP Code: foreach ($layout_data['layout_module'] as $layout_module) { RE: How to get to split the select value Question - John_Betong - 01-15-2016 (01-15-2016, 05:16 PM)wolfgang1983 Wrote: On my select drop down value I have it producing some thing like Try this: Code: echo '<br />$val => ', $val => codepen/4 $code => codepen $tmp => /4 $module_id => 4 |