here is a small peice off code that i wrote. But I am not getting the data in the view. It says undefined variable in the view
Controller
$data= array();
$data['']= json_decode(file_get_contents('http://localhost:8888/api/colleges'));
$this->load->view('colleges/index',$data);
View
foreach($data as $college) :
?>
<ul>
<li><label>ID:</label> <?php echo $college;?></li>
</ul>
<?php endforeach;?>