欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP实现在在图片上显示当前ip地址_PHP教程

程序员文章站 2024-01-11 16:50:40
...
  1. $img = ImageCreate(180,50);
  2. $ip = $_SERVER[REMOTE_ADDR];
  3. ImageColorTransparent($img,$bgcolor);
  4. $bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // 背景颜色
  5. $shadow = ImageColorAllocate($img, 250,0,0); // 阴影颜色
  6. $textColor = ImageColorAllocate($img, oxff,oxff,oxff); // 字体颜色
  7. ImageTTFText($img,10,0,78,30,$shadow,"c:/windows/fonts/Tahoma.ttf",$ip);
  8. //显示背景
  9. ImageTTFText($img,10,0,25,28,$textColor,"c:/windows/fonts/Tahoma.ttf","your ip is".$ip);
  10. // 显示IP
  11. ImagePng($img);
  12. imagecreatefrompng($img);
  13. ImageDestroy($img);
  14. ?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486127.htmlTechArticle?php $img = ImageCreate(180,50); $ip = $_SERVER[REMOTE_ADDR]; ImageColorTransparent($img,$bgcolor); $bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // 背景颜色 $shadow = I...

上一篇: 关于 Session 的深入探讨

下一篇: