Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Beranda extends CI_Controller {
- public function index() {
- $this->load->helper('runapi');
- $t['runapi'] = _runApi('https://www.medcom.id/feed/');
- $parsingrss = $t['runapi'];
- $raw = simplexml_load_string($parsingrss, "SimpleXMLElement", LIBXML_NOCDATA);
- $json = json_encode($raw);
- $info = json_decode($json,TRUE);
- $item= $info->channel->item;
- $image= $info->channel->image;
- //echo $movies->movie[0]->plot;
- $dt0=[
- strlen($parsingrss),
- count($item),
- $image,
- ];
- $dt=[];
- for($i=0;$i<5;$i++){
- $params=$info['channel']['item'][$i];
- $dt[]= [
- 'title'=>$params['title'],
- 'link'=>$params['link'],
- 'guid'=>$params['guid'],
- 'description'=>$params['description']
- ];
- }
- echo "<pre>";
- print_r($parsingrss);
- echo "</pre>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement