Linux-Fan

Very simple chapta idea

Mar 25th, 2012
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. function error() {
  4.         header("Content-Type: text/plain; charset=UTF-8");
  5.         exit(1);
  6. }
  7.  
  8. header("Content-Type: image/png");
  9.  
  10. $img = imagecreatetruecolor(0x100, 0x80);
  11. $black = imagecolorallocate($img, 0x00, 0x00, 0x00);
  12. imagefill($img, 0x00, 0x00, $black);
  13. imagestring($img, 4, 0x10, 0x10, "TEST", 0xffffff);
  14.  
  15. // Striche
  16. // rand(min, max)
  17. $max = rand(2, 8);
  18. for($i = 0; $i < $max; $i++) {
  19.         imageline($img, 0, rand(0, 0x100), 0x100, rand(0, 0x100), 0xffffff);
  20. }
  21.  
  22. imagepng($img);
  23. imagedestroy($img);
  24.  
  25. exit(0);
  26.  
  27. ?>
RAW Paste Data