Home > php教程 > php手册 > PHP实现在在图片上显示当前ip地址

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:40:15
Original
1146 people have browsed it

  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. ?>
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template