Array to String Conversion error in Codeigniter
08:28 08 Jan 2014

Well I am Stuck some where here in Array conversion:

My Controller:

$username = $this->input->post('FirstName');
$countryval= $this->input->post('country');
    
var_dump($countryval);

My View:


country_id.'">'.$row->country_name.'
'; } ?>

I am getting the value from checkbox in an array and I need to pass that value as a string further. I am not able to convert value from array to string i.e if I var_dump($countryval) I get value an array!

On selecting the 1st checkbox, I get output as:

array(1) { [0]=> string(1) "1" }

on selecting 2nd checkbox:

array(1) { [0]=> string(1) "2" }

php arrays string codeigniter submission