Guest User

Untitled

a guest
Dec 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <html>
  2.  
  3. <body>
  4.  
  5. <?php
  6. $str = "";
  7. $day = 8;
  8. $month = 8;
  9. $year = 2018;
  10. $wantedDate = mktime(0, 0, 0, $day, $month, $year);
  11. $current = time();
  12. if ($wantedDate < $current)
  13. $str = "the time has passed.";
  14. else
  15. {
  16. $seconds = $wantedDate - $current;
  17.  
  18. $days = floor($seconds/60/60/24);
  19. $hours = $seconds/60/60%24;
  20. $mins = $seconds/60%60;
  21. $secs = $seconds%60;
  22.  
  23. if($days>0) $str .= "$days days ";
  24. if($hours>0) $str .= "$hours hours ";
  25. if($mins>0) $str .= "$mins minutes ";
  26. if($secs>0) $str .= "$secs seconds ";
  27.  
  28. $str = trim($str);
  29. if($str==null) $str = '0 seconds';
  30. }
  31.  
  32.  
  33. $image = imagecreatefromjpeg ("image.jpg");
  34. $draw_color = imagecolorallocate($image , 0 , 0 , 0);
  35. $x = 0;
  36. $y = 0;
  37. $font = 4;
  38. $text = $str;
  39. imagestring($image ,$font , $x , $y , $text , $draw_color);
  40. header('Content-Type: image/jpg');
  41. imagejpeg($image);
  42.  
  43. echo "<img src =$image>";
  44. ?>
  45. </html>
Add Comment
Please, Sign In to add comment