最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 把ip生成在图片上
时间:2022-06-24 21:10:43 编辑:袖梨 来源:一聚教程网
| 代码如下 | 复制代码 |
|
$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生成图片功能,生成验证码也经常会用到这样的功能哦。
相关文章
- 冬季去杭州西湖旅游,更有可能欣赏到哪种美景 蚂蚁庄园今日答案1.12 08-05
- 蚂蚁庄园小课堂今日最新答案2026年1月12日 08-05
- 蚂蚁庄园小课堂2026年1月12日最新题目答案 08-05
- 在寒冷的冬天,湖里的鱼会冬眠吗 蚂蚁庄园今日答案1月12日 08-05
- 《我的世界手游》狐狸食物怎么获得-狐狸喜欢吃什么食物 08-05
- 幽灵捕捞是什么 神奇海洋1月12日答案最新 08-05