Question: how to pass data from controller to view php?
Answer: Pass array from controller to view Here's the controller code given below. You can paste it inside your controller file or could put in the controller object. $data['mega_header'][] = (object) array('title' => 'portfolio image' , 'img' => 'https://complete path of image' ); $this->load->view('multiple_array', $data);