Page is a not externally linkable
rocknbil - 4:12 pm on Sep 8, 2011 (gmt 0)
Well, since you have it in a foreach this implies multiple instances of $filename. You shouldn't need a global in the context of a single page, unless it's in a function. Is it?
You could do something like this:
<?php
$files = Array();
// Added only for your echo
$counter=0;
$rss = new SimpleXMLElement("http://$fqdn/rss/FreeDownloads.xml", null, true);
foreach($rss->xpath("channel/item") as $item) {
$files[] = basename($item->guid,".xml");
echo $files[$counter];
$counter++;
}
?>
Then you should have $files[0], $files[1], etc.
That should give you $files [ 0 ], $files [ 1 ] etc. (something on the board is messing up my example)