php中如何在图片里显示ip地址
程序员文章站
2022-06-13 14:34:34
...
PHP代码:
$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);
?>
下一篇: PHP新手入门学习方法
推荐阅读
-
php中如何在图片里显示ip地址
-
PHP代码片断(发送短信、根据IP查找地址、显示网页的源代码、检查服务器是否使用HTTPS、显示Faceboo*丝数量、检测图片的主要颜色、获取内存使用信息)
-
iphone来电显示归属地软件 php中获取远程客户端的真实ip地址的方法
-
PHP代码片断(发送短信、根据IP查找地址、显示网页的源代码、检查服务器是否使用HTTPS、显示Faceboo*丝数量、检测图片的主要颜色、获取内存使用信息)
-
php中如何在图片里显示ip地址_PHP教程
-
string - 如何在php中截取字符串“xxx_xxxx_IP地址_xxxxxxxx_xxxxxx”中的IP地址呢?
-
PHP实现在在图片上显示当前ip地址_PHP教程
-
PHP代码片断(发送短信、根据IP查找地址、显示网页的源代码、检查服务器是否使用HTTPS、显示Faceboo*丝数量、检测图片的主要颜色、获取内存使用信息)
-
string - 如何在php中截取字符串“xxx_xxxx_IP地址_xxxxxxxx_xxxxxx”中的IP地址呢?
-
iphone4s来电显示归属地软件 PHP 中检查或过滤IP地址的实现代码