Link to home
Start Free TrialLog in
Avatar of NiconPhantom
NiconPhantom

asked on

foreach in array

Hi guys,

I need to create an array and then serialize it and save to DB. My idea is something like that:

$header=array(
    foreach ($this->lang->lang_list() as $_lang => $_language)
        {
        $_lang => $this->input->post('header_'."$_lang"),
        }
    );

it be like:

$header = array('en' => 'english header from POST',
'ru' => ' russian header from POST',)

but I have no idea how to use foreach which should loop the list of available languages in this situation.
ASKER CERTIFIED SOLUTION
Avatar of Sudaraka Wijesinghe
Sudaraka Wijesinghe
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NiconPhantom
NiconPhantom

ASKER

Thank you sudaraka, I'll test that in 5-10 min, but it looks like 250p is yours :-)
Thank you Sudaraka that's what I need!
Glad to help. Thanks for the points.