Maybe my winamp signature will help you a bit.
Also, look up the functions array_rand(); and fread();
[codebox]<?php
ob_start();
header('Content-type: image/gif');
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');
function color($r = 0, $g = 0, $b = 0) {
global $img;
return imagecolorallocate($img,$r,$g,$b);
}
$gif = getimagesize("winamp.gif");
$handle = fopen("info.txt","r");
$song = fread($handle,filesize("info.txt"));
$width = 4 + $gif[0] + (strlen($song) * 7) + 3;
$height = 28;
$gif_image = imagecreatefromgif("winamp.gif");
$img = imagecreatetruecolor($width,$height);
imagecopy($img,$gif_image,1,1,0,0,$gif[0],$gif[1]);
$red = color(255);
$white = color(255,255,255);
imagestring($img,3,4 + $gif[0],$height / 3.75,$song,$white);
imageline($img, 0, 0, 0, $height, $red);
imageline($img, 0, 0, $width, 0, $red);
imageline($img, 0, $height - 1, $width, $height - 1, $red);
imageline($img, $width - 1, 0, $width - 1, $height - 1, $red);
imagegif($img);
imagedestroy($img);
?>[/codebox]