Welcome Guest, Not a member yet? Register   Sign In
$this->input->post question
#1

[eluser]europe72[/eluser]
foreach ($this->input->post() as $key => $value) ... doable?
#2

[eluser]xwero[/eluser]
No because the post method only checks if the key exists, cleans xss data if you want it and returns the value associated with that key.
You could extend the input class
Code:
function postarray( $xss_clean = FALSE)
    {        
        if ( ! isset($_POST) or count($_POST) == 0)
        {
            return FALSE;
        }

        if ($xss_clean === TRUE)
        {
                $keys = array_keys($_POST);
                    foreach($keys as $index)
                    {
                        if (is_array($_POST[$index]))
            {
                foreach($_POST[$index] as $key => $val)
                {                    
                    $_POST[$index][$key] = $this->xss_clean($val);
                }
            }
            else
            {
                $_POST[$index] = $this->xss_clean($_POST[$index]);
            }
                    }
        }

        return $_POST;
    }




Theme © iAndrew 2016 - Forum software by © MyBB