 <pre><code>$link="download.php/1000338/The%20Rise%20and%20Fall%20of%20Legs%20Diamond%20%5B1960%5D.avi.torrent"; $x=explode('/',$link); $id=$x[1]; </code></pre> <p>demo:<a href="http://codepad.viper-7.com/cWYXKe" rel="nofollow">http://codepad.viper-7.com/cWYXKe</a></p> <p>using your code:</p> <pre><code> $rss = simplexml_load_file('RSS FEED HERE'); echo '&lt;h1&gt;'. $rss-&gt;channel-&gt;title . '&lt;/h1&gt;'; foreach ($rss-&gt;channel-&gt;item as $item) { //echo the link echo '&lt;h2&gt;&lt;a href="'. $item-&gt;link .'"&gt;' . $item-&gt;title . "&lt;/a&gt;&lt;/h2&gt;"; //echo the date echo "&lt;p&gt;" . $item-&gt;pubDate . "&lt;/p&gt;"; //echo the description echo "&lt;p&gt;" . $item-&gt;description . "&lt;/p&gt;" $x=explode('/',$item-&gt;link); $id=$x[1]; } </code></pre> <p>then use $id any way you like</p>