PHP7中文手册2018 带注释 最新chm版
header("Content-type: image/gif"); $im = imagecreate(130,15); $background_color = ImageColorAllocate ($im, 255, 255, 255); unset($ip); if($_SERVER['HTTP_CLIENT_IP']){ $ip=$_SERVER['HTTP_CLIENT_IP']; } else if($_SERVER['HTTP_X_FORWARDED_FOR']){ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else{ $ip=$_SERVER['REMOTE_ADDR']; } $col = imagecolorallocate($im, 0, 51, 102); imagestring($im, 3, 5, 1, $ip , $col); imagegif($im); imagedestroy($im);
转载请注明:谷谷点程序 » php实现图形显示Ip地址的代码