I have an array $pname in view which I accessed from controller, when I write print_r($pname); output is:
Admin\Model\Provinces Object ( [id] => 4 [p_name] => Khyber Pakhtunkhwa [inputFilter:protected] => )
I need to show Khyber Pakhtunkhwa in view:
I tried echo $pname['p_name']; but it show me an error:
Fatal error: Uncaught Error: Cannot use object of type Admin\Model\Provinces as array in C:...
So how could I do this, i.e., access specific data from an array.