在很多地方我们都会看到把ip地址生成在图片哦,今天我们就来告诉你如何利用php 把ip生成在图片上哦,好了下面我们就来看看实例吧。
在很多地方我们都会看到把ip地址生成在图片哦,今天我们就来告诉你如何利用php教程 把ip生成在图片上哦,好了下面我们就来看看实例吧。
$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生成图片功能,生成验证码也经常会用到这样的功能哦。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.