1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <?php
ob_start();
@session_start();
header ("Content-type: image/png");
$text=$_SESSION['images'][$_GET['img']];
if($text=='')
exit;
$tab1 = array("&","é",""","'","à","â","ê","î","ô","û","ä","ë","ï","ö","ü","Â","Ê","Î","Ô","Û","Ä","Ë","Ï","Ö","Ü","ç");
$tab2 = array("&","é","\"","'","à","â","ê","î","ô","û","ä","ë","ï","ö","ü","Â","Ê","Î","Ô","Û","Ä","Ë","Ï","Ö","Ü","ç");
$text = str_replace ($tab1,$tab2,$text) ;
$string = utf8_decode($text);
$font = 4;
$width = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font);
$im = @imagecreate ($width,$height);
$background_color = imagecolorallocate ($im, 255, 255, 255); //white background
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, 0, 0, $string, $text_color);
echo imagepng ($im);
?> |
Partager