Advertisement
kura2yamato

update 91

Mar 8th, 2019
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. $t['curl']                = _runApi('https://www.medcom.id/feed/');
  3.         $parsingrss               = $t['curl'];
  4.  
  5.         $raw                      =   simplexml_load_string($parsingrss, "SimpleXMLElement", LIBXML_NOCDATA);
  6.         $json                     = json_encode($raw);
  7.         $info                     = json_decode($json,TRUE);
  8.          
  9.        // $item                     = $info->channel->item;
  10.          
  11.        // $image                    = $info->channel->image;
  12.         //echo $movies->movie[0]->plot;
  13.         /*
  14.         $dt0=[
  15.             strlen($parsingrss),
  16.             count($item),
  17.             $image,
  18.         ];
  19.         */
  20.         $dt=array();
  21.         for($i=0;$i<5;$i++){
  22.             $params=$info['channel']['item'][$i];
  23.            
  24.             $dt[]= [
  25.                 'title'=>$params['title'],
  26.                 'link'=>$params['link'],
  27.                 'guid'=>$params['guid'],
  28.                 'description'=>$params['description']
  29.             ];
  30.         }
  31.         echo "<pre>";
  32.         print_r($dt);    
  33.         echo "</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement