php - array to string conversion error in codeginiter in controller -
$data = array('first_name' => $this->input->post('fname'), 'middle_name' => $this->input->post('mname'), 'last_name' => $this->input->post('lname'), 'email_name' => $this->input->post('email'), 'pwd_name' => $this->input->post('pwd'), 'cno_name' => $this->input->post('cno'), 'gender_name' => $this->input->post('gender'), 'country_name' => $this->input->post('country'), 'lang_name' => $this->input->post('lang') ); echo $data;
i want echo or print $data, showing error severity: notice
message: array string conversion
method 1
foreach($data $key => $val) echo($key.' => '.(is_array($val)?implode(',', $val):$val).'<br>');
method 2
var_dump($data);
method 3
print_r($data);
Comments
Post a Comment