title: RSS Feed fetch as a JSON object
body: <p>This is my PHP file named testClient </p>
  
  <pre><code>  **public function getXML() {
  
          $xml = simplexml_load_file('https:/.............');
          $feed1 = '&lt;h3&gt;' . $xml-&gt;channel-&gt;title . '&lt;/h3&gt;';
          foreach ($xml-&gt;channel-&gt;item as $item) {
              $feed1 .= '&lt;h4&gt;&lt;a href="' . $item-&gt;link . '"&gt;' . $item-&gt;title . "&lt;/a&gt;&lt;/h4&gt;";
          }
          $xml = simplexml_load_file('https://rumble.com/rss.php?target=sprinklevideo');
          $feed2 = '&lt;h3&gt;' . $xml-&gt;channel-&gt;description . '&lt;/h3&gt;';
          foreach ($xml-&gt;channel-&gt;item as $item) {
              $feed2 .= '&lt;h4&gt;&lt;a href="' . $item-&gt;link . '"&gt;' . $item-&gt;description . "&lt;/a&gt;&lt;/h4&gt;";
          }
  
  
          $xml = simplexml_load_file('https://rumble.com/rss.php?target=sprinklevideo');
          $feed3 = '&lt;h3&gt;' . $xml-&gt;channel-&gt;link . '&lt;/h3&gt;';
          foreach ($xml-&gt;channel-&gt;item as $item) {
              $feed3 .= '&lt;h4&gt;&lt;a href="' . $item-&gt;link . '"&gt;' . $item-&gt;link . "&lt;/a&gt;&lt;/h4&gt;";
          } 
          return $feed1;
  }**
  </code></pre>
  
  <p>This is my controller class where i want to viewing the result</p>
  
  <pre><code>**
  
  use VideoBundle\VideoProviderClient\testClient as testClient;
      class MainController extends Controller
      {
  
     public function MainAction() {
          $zoo = new testClient();
          $val = $zoo-&gt;getXML();
  
          //dump 
          echo "&lt;pre&gt;";
          var_dump($val);       
          echo "&lt;/pre&gt;";
          die();
          return new Response("$val");
      }
      public function setVal($val) {
          $this-&gt;item = json_encode($val);
          return $this;
      }
      public function getVal() {
          if ($this-&gt;item) {
              return json_decode($val);
          }
          return null;
      }
  </code></pre>
  
  <p>**</p>
  
  <p>If i want to fetch data from RSS feed like title/description/link, i am getting those. But HOW CAN I GET ALL THOSE DATA AS A JSON OBJECT. Because in rss feed the data is saving as a item.</p>
  
  <p>This is a sample "item" data from RSS feed ---</p>
  
  <p>**</p>
  
  <pre><code>&lt;item&gt;
  &lt;title&gt;Newlyweds stun guests with epic first dance&lt;/title&gt;
  &lt;description&gt;
  your foot in time to the music!
  &lt;/description&gt;
  &lt;link&gt;
  https://zzx.com/v2zl27-bride-and-groom-perform-the-best-first-dance-ever-to-a-swingin-classic.html
  &lt;/link&gt;
  &lt;guid isPermaLink="false"&gt;media/8.5087&lt;/guid&gt;
  &lt;pubDate&gt;2015-06-03 12:49:16&lt;/pubDate&gt;
  &lt;media:category scheme="http://search.yahoo.com/mrss/category_schema"&gt;viral&lt;/media:category&gt;
  &lt;media:keywords&gt;
  viral videos, inspiring first wedding dance, songs for first wedding dance
  &lt;/media:keywords&gt;
  &lt;media:thumbnail url="https://rumble.com/rss/8-5019487.jpg" /&gt;
  &lt;media:player url="https://asdas.com/bin/8_8" height="426" width="491" /&gt;
  &lt;media:content url="https://i.rmbl.ws/s8/d99" type="video/mp4" /&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p>**</p>
  
  <p>Thanks in advance ...</p>