Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing data from form array with codeigniter

I have a form like this

<form>
 <input type="text" name="personal_details[]" />
 <input type="text" name="personal_details[]" />

 <input type="text" name="pictures[]" />
 <input type="text" name="pictures[]" />
</form>

With php I can access data like this

$name    = $_POST['personal_details'][0];
$surname = $_POST['personal_details'][1];
etc.. etc

Is it possible to do this task with codeigniter input class ?

like image 259
Dro1n2 Avatar asked May 20 '26 12:05

Dro1n2


1 Answers

They work basically the same.

$personal_details = $this->input->post('personal_details');
$pictures = $this->input->post('pictures');

$name = $personal_details[0];
$surname = $personal_details[1];
like image 78
Teej Avatar answered May 23 '26 03:05

Teej



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!