PHP Image-from-Text Generator


/ Published in: PHP
Save to your folder(s)

by m13579m


Copy this code and paste it in your HTML
  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. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.