Questo è l'esempio che riporta il manuale ufficiale di PHP.
Prova un po' se così ti funziona?
Vedi un po' se così ti funziona?Codice PHP:<?php
// definizione della stringa da scrivere nella foto
$string = "tuaemail@dominio.com";
// impostazioni
$font = 4;
$width = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font);
// Crea l'immagine di base
$im = imagecreate($width, $height);
// background bianco e testo blu
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
// Scrivi il testo nell'immagine
imagestring($im, 5, 0, 0, $string, $textcolor);
// Output the image
header('Content-type: image/jpg');
imagejpeg ($im);
imagedestroy($im);
?>
![]()

Rispondi quotando