title: PHP get img src from xml
body: <p>I have a page with xml that looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;rss version="2.0"&gt;
    &lt;channel&gt;
      &lt;title&gt;FB-RSS feed for Salman Khan  Fc&lt;/title&gt;
      &lt;link&gt;http://facebook.com/profile.php?id=1636293749919827/&lt;/link&gt;
      &lt;description&gt;FB-RSS feed for Salman Khan  Fc&lt;/description&gt;
      &lt;managingEditor&gt;http://fbrss.com (FB-RSS)&lt;/managingEditor&gt;
      &lt;pubDate&gt;31 Mar 16 20:00 +0000&lt;/pubDate&gt;
      &lt;item&gt;
        &lt;title&gt;Photo - Who is the Best Khan ?&lt;/title&gt;
        &lt;link&gt;https://www.facebook.com/SalmanKhanFns/photos/a.1639997232882812.1073741827.1636293749919827/1713146978901170/?type=3&lt;/link&gt;
        &lt;description&gt;&amp;lt;a href=&amp;#34;https://www.facebook.com/SalmanKhanFns/photos/a.1639997232882812.1073741827.1636293749919827/1713146978901170/?type=3&amp;#34;&amp;gt;&amp;lt;img src=&amp;#34;https://scontent.xx.fbcdn.net/hphotos-xap1/v/t1.0-0/s130x130/11059765_1713146978901170_8711054263905505442_n.jpg?oh=fa2978c5ecfb3ae424e9082aaa057b8f&amp;amp;oe=57BB41D5&amp;#34;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Who is the Best Khan ?&lt;/description&gt;
        &lt;author&gt;FB-RSS&lt;/author&gt;
        &lt;guid&gt;1636293749919827_1713146978901170&lt;/guid&gt;
        &lt;pubDate&gt;31 Mar 16 20:00 +0000&lt;/pubDate&gt;
      &lt;/item&gt;
      &lt;item&gt;
        &lt;title&gt;Photo&lt;/title&gt;
        &lt;link&gt;https://www.facebook.com/SalmanKhanFns/photos/a.1636293813253154.1073741825.1636293749919827/1713146755567859/?type=3&lt;/link&gt;
        &lt;description&gt;&amp;lt;a href=&amp;#34;https://www.facebook.com/SalmanKhanFns/photos/a.1636293813253154.1073741825.1636293749919827/1713146755567859/?type=3&amp;#34;&amp;gt;&amp;lt;img src=&amp;#34;https://scontent.xx.fbcdn.net/hphotos-xap1/v/t1.0-0/s130x130/12294686_1713146755567859_6728330714340999478_n.jpg?oh=6d90a688fdf4342f9e12e9ff9a66b127&amp;amp;oe=57778068&amp;#34;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/description&gt;
        &lt;author&gt;FB-RSS&lt;/author&gt;
        &lt;guid&gt;1636293749919827_1713146755567859&lt;/guid&gt;
        &lt;pubDate&gt;31 Mar 16 19:58 +0000&lt;/pubDate&gt;
      &lt;/item&gt;
    &lt;/channel&gt;
  &lt;/rss&gt;
  </code></pre>
  
  <p><strong>I want to get the <code>src</code>s of the <code>img</code>s in the <code>xml</code> above.</strong></p>
  
  <p>The images are stored in the <code>&lt;description&gt;</code> however, they are not in the format of</p>
  
  <p><code>&lt;img...</code>  </p>
  
  <p>they rather look like:</p>
  
  <p><code>&amp;lt;img src=&amp;#34;https://scontent.xx.fbc...</code> . </p>
  
  <p>the <code>&lt;</code> is replace with <code>&amp;lt;</code>... I guess thats why <code>$imgs = $dom-&gt;getElementsByTagName('img');</code> returns nothing.</p>
  
  <p>Is there any work around?</p>
  
  <p>This is how I call it:</p>
  
  <pre><code>libxml_use_internal_errors(true);
  $dom = new DOMDocument();
  $dom-&gt;loadXML( $xml_file);
  $imgs = ...(get the imgs to extract the src...('img') ??;
  
  //Then run a possible foreach
  //something like:
  
  foreach($imgs as $img){
  
     $src= ///the src of the $img
  
     //try it out
     echo '&lt;img src="'.$src.'" /&gt; &lt;br /&gt;',
  }
  </code></pre>
  
  <p>Any Idea?</p>