Guest User

Untitled

a guest
Jan 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. if(isset($_GET['v']) && extension_loaded('gd') && function_exists('gd_info')){
  3. $string = $_GET['v'];
  4. $font_size = 4;
  5.  
  6. $width = imagefontwidth($font_size)*strlen($string);
  7. $height = imagefontheight($font_size);
  8. $img = imagecreate($width,$height);
  9. $bg = imagecolorallocate($img, 25, 25, 25);
  10. $color = imagecolorallocate($img, 255, 255, 255);
  11. $len = strlen($string);
  12. $ypos = 0;
  13. for($i=0;$i<$len;$i++){
  14. $xpos = $i * imagefontwidth($font_size);
  15. imagechar($img, $font_size, $xpos, $ypos, $string, $color);
  16. $string = substr($string, 1);
  17.  
  18. }
  19. header("Content-Type: image/png");
  20. imagepng($img);
  21. imagedestroy($img);
  22. }
  23. ?>
Add Comment
Please, Sign In to add comment