Welcome Guest, Not a member yet? Register   Sign In
$this->input->post() not working for me


I am currently trying to use $this->input->post() in my controller but it doesn't seem to be working.

I currently have it so a select has a name of grau[] (an array).

In the controller, I try to do something like:

$data['grau_field'] = 'grau[]';

$data['education_count'] = count( $this->input->post($data['grau_field']) );

It doesn't seem to be showing the correct count, even though I can see that the POST values are there. (via the Profiler)

Could anybody please assist me?

Thanks in advance.

try removing the brackets from your grau_field value.

That would make the input not an array would it not? I need it as an array.

Ah I got it thanks.

I removed the brackets from the post() like you said.

Another question:

How can I retrieve a certain value from an array?

    [0] => ABC
    [1] => XYZ

How can I get the value for the second key?

[eluser]Colin Williams[/eluser]

Theme © iAndrew 2016 - Forum software by © MyBB