$img = imagecreate(180,50);
$ip = $_server['remote_addr'];
imagecolortransparent($img,$bgcolor);
$bgcolor = imagecolorallocate($img, 0x2c,0x6d,0xaf); // 背景颜色
$shadow = imagecolorallocate($img, 250,0,0); // 阴影颜色
$textcolor = imagecolorallocate($img, oxff,oxff,oxff); // 字体颜色
imagettftext($img,10,0,78,30,$shadow,"c:/windows/fonts/tahoma.ttf",$ip);
//显示背景
imagettftext($img,10,0,25,28,$textcolor,"c:/windows/fonts/tahoma.ttf","your ip is".$ip);
// 显示ip
imagepng($img);
imagecreatefrompng($img);
imagedestroy($img);