Question: how to pass data from controller to view in php?
Answer: Pass array from controller to view 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);