jaypabs
jaypabs

Reputation: 1567

Accessing field value array using codeigniter input->post

I tried everything to get this code below to work with codeigniter.

$arrival_date = $_POST['arrival_date'][$re_id]

Here's what I do it in codeigniter:

$arrival_date = $this->input->post('arrival_date'[$re_id]);
$arrival_date = $this->input->post('arrival_date')[$re_id];
$arrival_date = $this->input->post('arrival_date[$re_id]');

All the above three code failed.

Anyone know how to do this in codeigniter?

Upvotes: 0

Views: 1372

Answers (1)

Sergey Telshevsky
Sergey Telshevsky

Reputation: 12197

$x = $this->input->post('arrival_date');
$arrival_date = $x[$re_id];

If your array in the form looks like name="arrival_date[re_id]", then

$arrival_date = $x['re_id'];

I could help more if you would show the form too.

Upvotes: 2

Related Questions