I have the following code:
$recent = apc_fetch('recn');
$recent[9] = $recent[8];
$recent[8] = $recent[7];
$recent[7] = $recent[6];
$recent[6] = $recent[5];
$recent[5] = $recent[4];
$recent[4] = $recent[3];
$recent[3] = $recent[2];
$recent[2] = $recent[1];
$recent[1] = $recent[0];
$rec = array_pop($recent);
$recent[0] = $name;
apc_store('recn', $recent);
Each time the page is reloaded, I wanted $name to be 1st, and than move whatever is 2nd down the list, and so on. I echo the array like so:
echo "Most Recent Songs: <br>";
echo "1. " . $name. "<br>";
echo "2. " . $recent[1] . "<br>";
echo "3. " . $recent[2] . "<br>";
echo "4. " . $recent[3] . "<br>";
echo "5. " . $recent[4] . "<br>";
echo "6. " . $recent[5] . "<br>";
echo "7. " . $recent[6] . "<br>";
echo "8. " . $recent[7] . "<br>";
echo "9. " . $recent[8] . "<br>";
echo "10. " . $recent[9] . "<br>";
But only the first entry shows up.