Maison  >  Article  >  développement back-end  >  PHP实现在在图片上显示当前ip地址_PHP教程

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

WBOY
WBOYoriginal
2016-07-13 17:41:25717parcourir

  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...
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn