I am using the following code:
while($row = mysql_fetch_array($sql))
{
$thetest[] = $row[length];
$thename[] = $row[filename];
$theid[] = $row[Id];
}
$aTimes = $thetest;
$iMin = min($aTimes);
$iFill = 3600;
$aFinal = array();
$iTotal = 0;
foreach( $aTimes as $iTime )
{
if( $iTotal + $iTime <= $iFill )
{
$iTotal += $iTime;
$aFinal[] = $iTime;
}
if( $iTotal == $iFill || ($iFill - $iTotal) < $iMin )
{
break;
}
}
print"
<rss version=\"2.0\" xmlns:jwplayer=\"http://rss.jwpcdn.com/\">
<channel>
";
array_walk($aFinal, function ($code,$filename) use ($thename)
{
{
print "
<item>
<title>$code</title>
<description></description>
<jwplayer:image></jwplayer:image>
<jwplayer:source file=\"http://website/demos/mp3/$thename[$filename]\" />
</item>
";
}
});
How can I get the variable for $theid to print in my <description></description> tag? I think I need to place it in the array_walk but I am not sure how to do that. Any idea?
My goal is to create an rss feed from the variables.
Thanks in advance for any help.