Created
June 2, 2021 15:26
-
-
Save arthur-tomsjj/9b781b419fdea79c74db9d8268ff35a2 to your computer and use it in GitHub Desktop.
php動態圖片
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$rnd_img = rand(1,5) | |
$im = imagecreatefrompng("sample".strval($rnd_img).".png"); | |
$text_color = imagecolorallocate($im,0,0,100); | |
imagestring($im, 5, 100, 25, $ip, $text_color); | |
header("Content-type: image/png"); | |
imagepng($im); | |
imagedestroy($im); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment