In this article, I am going to explain A view is a webpage that displays all the elements of the UI. In many cases, the view is often a fragment of the page (such as header, footer, widget areas, and sidebars). In many cases, views can be embedded in other views. One important aspect of views is that views could not be called directly. You need to load the views through a controller.
Try this in the controller,
function checkedServices()
{
$data = array();
foreach($this->input->post('check_service') as $ser) {
$data[]['service'] = $ser;
}
$checked_services['services'] = $data;
$this->load->view('checked_services', $checked_services);
}
Try this in view,
<?php
foreach($services as $ser)
{
echo $ser['service'];
}?>