Posted By

irm on 10/10/09


Tagged

php image generator web


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

adiian


PHP Image-from-Text Generator


 / Published in: PHP
 

URL: http://forum.zloy.bz/showthread.php?t=91235

by m13579m

  1. <?
  2. header("Content-type: image/png");
  3. header("Refresh: 30");
  4. $txt = 'temp.txt'; #файл откуда брать
  5. $txt2 = 'not.txt'; #куда записать те что были показаны
  6. $img = imagecreate(200,200);
  7. $b = imagecolorallocate($img,0,0,0);
  8. $w = imagecolorallocate($img,255,255,255);
  9. $f = "arial.ttf"; #файл шрифта
  10. $file=file($txt);
  11. imagettftext($img,10,0,20,100,$w,$f,$file[0]);
  12. imagepng($img);
  13. $w = fopen($txt2,"a");
  14. fwrite($w,$file[0]);
  15. fclose($w);
  16. unset($file[0]);
  17. $fp=fopen($txt,"w");
  18. fputs($fp,implode("",$file));
  19. fclose($fp);
  20. ?>

Report this snippet  

You need to login to post a comment.