I want to get a specific field of an array but it keeps on sending me error like Undefined index: in or Cannot use object of type stdClass as array in.I'm using codeigniter and this array is from my model and it is returned in my controller. Here is my controller.
$data['inpatient'] = $this->billing_model->retrieveinpatient();
echo $data['inpatient']['in'];
Here is the structure of my array:
Array
(
[inpatient] => Array
(
[0] => stdClass Object
(
[iid] => 1
[in] => IN
)
)
)
Any help?