Welcome Guest, Not a member yet? Register   Sign In
this->input() as array?
#6

[eluser]A.M.F[/eluser]
thank u, u helped me. before i saw ur reply i rewrite my function and it was like this:

Code:
function make_arr_session($arr, $name, $trash = '')
{
    $object =& get_instance();
    
    $data = Array();
    $dump = FALSE;

    foreach($arr as $k=>$v)
    {
        if ($trash != '') {
            foreach($trash as $field)
            {
                if ($field == $k) //we don't need the field?
                {
                    $dump = TRUE;
                }
            }
        }
        
        if (!$dump)
        {
            $data[$k] = $object->input->post($k, TRUE);
        }

        $dump = FALSE;
    }
    
    $object->session->set_userdata($name, $data);
}



but then i saw (thanks to u) that instead of using foreach twice, i can just use in_array. thank u!


Messages In This Thread
this->input() as array? - by El Forum - 12-10-2007, 01:43 PM
this->input() as array? - by El Forum - 12-10-2007, 01:56 PM
this->input() as array? - by El Forum - 12-10-2007, 02:02 PM
this->input() as array? - by El Forum - 12-11-2007, 11:09 AM
this->input() as array? - by El Forum - 12-11-2007, 11:53 AM
this->input() as array? - by El Forum - 12-11-2007, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB